I am using a knock-off 5 volt ProMicro https://www.banggood.com/Wholesale-...ompatible-Nano-Size-p-68534.html?rmmds=search . I am trying to send a value to an output pin depending on which of three input pins (A0,A1,A2) is receiving a digital 5 volt input signal. I would like to poll the input pins once power is supplied to the raw input of the ProMicro. When I supply power to any one of the three input pins without supplying power to the raw pin, the ProMicro activates and runs the program. I am using the following code with A0 as my only input to troubleshoot the issue:
Should I expect the ProMicro to activate without supplying power to raw and any or all of A0, A1, A2 is set to high?
If so, is there a way to only power the ProMicro using the raw pin irregardless of whether or not A0, A1, and/or A2 is set high?
Code:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(A0, INPUT);
}
// the loop function runs over and over again forever
void loop() {
if(A0, HIGH)
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(2000);
}// wait for a second
else
{
digitalWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(20); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED off by making the voltage LOW
delay(2000);
}
}
Should I expect the ProMicro to activate without supplying power to raw and any or all of A0, A1, A2 is set to high?
If so, is there a way to only power the ProMicro using the raw pin irregardless of whether or not A0, A1, and/or A2 is set high?