0% found this document useful (0 votes)
12 views

Coding Glukosa

This code is initializing an INA219 current sensing board and LCD display to monitor current readings from a sensor and display the current and calculated blood glucose levels on the LCD screen. It includes the necessary library codes, initializes the INA219 and LCD objects, and has a loop function that reads the current from the sensor, calculates the blood glucose level, and displays both on the LCD at half second intervals.

Uploaded by

Muhammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Coding Glukosa

This code is initializing an INA219 current sensing board and LCD display to monitor current readings from a sensor and display the current and calculated blood glucose levels on the LCD screen. It includes the necessary library codes, initializes the INA219 and LCD objects, and has a loop function that reads the current from the sensor, calculates the blood glucose level, and displays both on the LCD at half second intervals.

Uploaded by

Muhammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

// include the library codes:

#include <Wire.h>
#include <Adafruit_INA219.h>
#include <LiquidCrystal.h>
Adafruit_INA219 ina219;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
ina219.begin(); // Initialize current sensing board (default address
0x40)
// set up the LCD's number of columns and rows:
Lcd.begin(16,2) ;
// initialize the serial communications:
Serial.begin(9600);
}
void loop()
{
float shuntvoltage = 0;
float current_mA = 0;
float bloodglucose =0;
shuntvoltage = ina219.getShuntVoltage_mV();
current_mA = ina219.getCurrent_mA();
//set the cursor to column 0, line 0
Lcd.setcursor (0,0);
Lcd.print("Current: "); Lcd.print(current_mA); Lcd.println(" mA");
Lcd.setcursor (0,1);
Lcd.print("Blood Glucose: "); Lcd.print(Blood_mM); Lcd.println("
mMole");
Lcd.println("");
// Delay program for a few milliseconds
delay(500);
}

You might also like