Pengukuran Kualitas Air Mineral Dengan Atmega 328p Berbasis Arduino

LAMPIRAN

Program yang digunakan pada mikrokontroller

#include
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
int sensorValue = 0;
// the setup routine runs once when you press reset:
void setup()
{
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(0, 0); lcd.print("Matius");
lcd.setCursor(0, 1); lcd.print("142411034");
delay(3000);
lcd.clear(); delay(1000);
}
// the loop routine runs over and over again forever:
void loop()
{

// read the input on analog pin 0:
int sensorValue = analogRead(A7);
// print out the value you read:
Serial.println(sensorValue);
lcd.setCursor(0, 0); lcd.print("kualitas air");
lcd.setCursor(0, 1); lcd.print(sensorValue);
delay(1000);
// delay in between reads for stability
}

Universitas Sumatera Utara