Sistem Pengukuran Kadar Aseton Dengan Nafas Berbasis Arduino Nano Dengan Tampilan Android
41
LAMPIRAN
Universitas Sumatera Utara
42
LAMPIRAN RANGKAIAN LENGKAP 1
Universitas Sumatera Utara
43
LAMPIRAN RANGKAIAN LENGKAP 1
Universitas Sumatera Utara
44
LAMPIRAN PROGRAM LENGKAP
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to
the serial monitor.
Graphical representation is available using serial
plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and
the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup function runs once when you press reset or
power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
*/
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH);
delay(50);
digitalWrite(13, LOW);
Universitas Sumatera Utara
45
delay(50)
}
#include
//
initialize
the
library
with
the
numbers
of
the
interface pins
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// the setup routine runs once when you press reset:
// initialize serial communication at 9600 bits per
second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
void setup() {
Serial.begin(9600);
}
void loop() {
float sensorValue = analogRead(A0);
Universitas Sumatera Utara
46
lcd.clear ();
float data=analogRead (A0);
lcd.setCursor (0,0);
lcd.print ("Out = ");
lcd.print(sensorValue * 0.4887);
lcd.print (" mV");
lcd.setCursor (0,1);
lcd.print ("Sen = ");
float tegangan=sensorValue * 0.4887;
float sensitivitas = ((tegangan-232.39)/tegangan)*100;
if (sensitivitas
LAMPIRAN
Universitas Sumatera Utara
42
LAMPIRAN RANGKAIAN LENGKAP 1
Universitas Sumatera Utara
43
LAMPIRAN RANGKAIAN LENGKAP 1
Universitas Sumatera Utara
44
LAMPIRAN PROGRAM LENGKAP
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to
the serial monitor.
Graphical representation is available using serial
plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and
the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup function runs once when you press reset or
power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
*/
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH);
delay(50);
digitalWrite(13, LOW);
Universitas Sumatera Utara
45
delay(50)
}
#include
//
initialize
the
library
with
the
numbers
of
the
interface pins
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// the setup routine runs once when you press reset:
// initialize serial communication at 9600 bits per
second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
void setup() {
Serial.begin(9600);
}
void loop() {
float sensorValue = analogRead(A0);
Universitas Sumatera Utara
46
lcd.clear ();
float data=analogRead (A0);
lcd.setCursor (0,0);
lcd.print ("Out = ");
lcd.print(sensorValue * 0.4887);
lcd.print (" mV");
lcd.setCursor (0,1);
lcd.print ("Sen = ");
float tegangan=sensorValue * 0.4887;
float sensitivitas = ((tegangan-232.39)/tegangan)*100;
if (sensitivitas