int red = 21;
int green = 22;
int blue = 23;
int angka = 3;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
while (angka >= 0, angka++){
RGB(1, 0, 0);
delay(300);
RGB(1, 1, 0);
delay(300);
RGB(0, 1, 0);
delay(300);
RGB(0, 1, 1);
delay(300);
RGB(0, 0, 1);
delay(300);
RGB(1, 0, 1);
delay(300);
RGB(1, 1, 1);
delay(300);
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
void RGB(bool pinred, bool pingreen, bool pinblue){
digitalWrite(blue, pinblue);
digitalWrite(green, pinblue);
digitalWrite(red, pinred);
}