const int pinSensor = A0;
int adcValue = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(pinSensor, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
adcValue =analogRead(pinSensor);
// cetak nilai adc ke serial monitor
Serial.print("nilai adc: ");
Serial.println(adcValue);
// jeda akuisisi data
delay(100); // this speeds up the simulation
}