#define pinLed1 12
#define pinLed2 11
#define pinLed3 10
#define pinLed4 9
#define pinButton1 8
#define pinButton2 7
//variabel bilangan bulat
int dataPertama = 100;
int dataButton1 = 0;
int dataButton2 = 0;
int menu = 0;
//variabel bilangan pecahan
float dataKedua = 100.7;
void setup(){
pinMode(pinLed1, OUTPUT);
pinMode(pinLed2, OUTPUT);
pinMode(pinLed3, OUTPUT);
pinMode(pinLed4, OUTPUT);
pinMode(pinButton1, INPUT);
pinMode(pinButton2, INPUT);
Serial.begin(9600);
}
void loop(){
Serial.print("menu : ");
Serial.println(menu);
dataButton1 = digitalRead(pinButton1);
dataButton2 = digitalRead(pinButton2);
Serial.println(dataButton1);
Serial.println(dataButton2);
if(dataButton1 == 1){
menu = menu + 1;
}
if(dataButton2 == 0){
menu = menu - 1;
}
delay(100);
}
nano:12
nano:11
nano:10
nano:9
nano:8
nano:7
nano:6
nano:5
nano:4
nano:3
nano:2
nano:GND.2
nano:RESET.2
nano:0
nano:1
nano:13
nano:3.3V
nano:AREF
nano:A0
nano:A1
nano:A2
nano:A3
nano:A4
nano:A5
nano:A6
nano:A7
nano:5V
nano:RESET
nano:GND.1
nano:VIN
nano:12.2
nano:5V.2
nano:13.2
nano:11.2
nano:RESET.3
nano:GND.3
led1:A
led1:C
led2:A
led2:C
led3:A
led3:C
led4:A
led4:C
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
btn2:1.l
btn2:2.l
btn2:1.r
btn2:2.r
r1:1
r1:2
r2:1
r2:2
pot1:GND
pot1:SIG
pot1:VCC