/* Hello Wokwi! */
// constants won't change. Used here to set a pin number:
const int ledPin = 4; // the number of the LED pin
const int add1 =2;
const int add2 =3;
const int add3 =4;
const int add4 =5;
const int signalout =8;
// const int enable =9; low to enable
// Variables will change:
int ledState = LOW; // ledState used to set the LED
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated
// constants won't change:
const long interval = 1000; // interval at which to blink (milliseconds)
void setup() {
// set the digital pin as output:
pinMode(ledPin, OUTPUT);
pinMode(add1, OUTPUT);
pinMode(add2, OUTPUT);
pinMode(add3, OUTPUT);
pinMode(add4, OUTPUT);
pinMode(signalout, OUTPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
digitalWrite(signalout, HIGH);
}
void loop()
{ Serial.begin(9600);
int address =0;
int dd1 =0;
int dd2 =0;
int dd3 =0;
int dd4 =0;
int sequence =0;
do {
do {
// Convert the analog value into lux value:
dd1 = analogRead(A0);
delay(50);
dd2 = analogRead(A1);
delay(50);
dd3 = analogRead(A2);
delay(50);
dd4 = analogRead(A3);
delay(500);
Serial.println(dd1);
Serial.println(dd2);
Serial.println(dd3);
Serial.println(dd4);
Serial.println("*********");
//Serial.println("---------------------");
digitalWrite(add1, address & 0b0001);
digitalWrite(add2, address & 0b0010);
digitalWrite(add3, address & 0b0100);
digitalWrite(add4, address & 0b1000);
delay(300);
address++;
} // increase i by 1
while (address < 15); // repeat 100 times
sequence++;}
while (sequence <101);
}
// set the LED with the ledState of the variable:
//.. digitalWrite(ledPin, ledState);