trying to program my pi pico using arduino ide. for some reason, i can't get digitalRead to work.
March 12, 2023, 18:51
fragginright
I've got it printing the value of digitalRead to the serial. even if i take a jumper wire and connect it directly to my input pin, i get nothing. it still reads as low.
fragginright
this is my test code:
int sensorPin = 10;
int sensorState = 0;
void setup()
{
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
sensorState = digitalRead(sensorPin);
Serial.println(sensorState);
sleep_ms(100);
}
oops.se
And I would increase
sleep_ms(100);
to a larger number (1000) since it will spit out 10 messages/second.
andy_s
as i already told you in main chat, since you piped 5V into 3V3 logic input, you most probably fried that input...
oops.se
I think you <@456538086453805068> remembered it wrong, I made him aware of the 3,3 vs 5v issue first!
andy_s
you are correct, you did 🙂 i completely overlooked your reply, sorry