Hi,
Brand new here and no clue what we're doing. My son and I are using a Wemos D1 Mini. We have a circuit built with two outputs. When low, those outputs are around 20 mV, when high, 3.25 V.
We have them hooked up to input pins D1 and D2 on the Wemos. We are using output pins D5,D6, and D7 that go to an RGB LED. By playing with the code, we can get the RGB to light correctly.
In essence, we're using the Wemos to eliminate AND, XOR, and NOR gates we were using in the original circuit. Once solved, we also plan on using the wifi capability to alert when certain conditions exist..
We've tried to code so that when D1 and D2 are high, D5 is high, D1 or D2 is high, D6 is high, D1 and D2 are low, D7 is high.
Regardless of the state of the inputs, D7 is always high. My son at looked other examples to try to figure out the code and this is what he came up with -
void setup() {
pinMode(D1, INPUT);
pinMode(D2, INPUT);
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT);
}
void loop() {
//digitalWrite(D5, HIGH);
//digitalWrite(D6, HIGH);
//digitalWrite(D7, HIGH);
if (digitalRead(D1) == HIGH && digitalRead(D2) == HIGH) {
digitalWrite(D5, HIGH);
} else if (digitalRead(D1) == HIGH || digitalRead(D2) == HIGH) {
digitalWrite(D6, HIGH);
} else {
digitalWrite(D7, HIGH);
}
}
Can anyone point us in the right direction?
Thank you!