-
• #2
Ahh, I think you might have hit the 'console on Serial1' issue. Basically when you disconnect from USB the console moves onto Serial1 (which is pins B6 and B7) by default - and you're using B7.
So you have two options:
- Add
USB.setConsole(1)
right at the top ofonInit
, which should force the console onto USB forever, so it never messes with your pins. - Move
B7
to some other pin
I reckon that should sort it out.
- Add
-
• #3
Thanks for your reply Gordon, I’ll give the
USB.setConsole(1)
a try. This has been driving me nuts!! -
• #4
Thank you Gordon for your help, this worked.
Hello everyone,
I’m looking for some help on my project. I had the idea of having switches in my gearstick and then a seven segment display show what gear I was in.
So I have a Pico with switches on B3, B4, B5, B7 and A8, they have a common positive 3.3 from the pin next to B3.
Gear - Active Switches
1 = B4 & A8
2 =B4 & B7
3 = A8
4 = B7
5 = B5 & A8
6 = B5 & B7
R = B3, B4 & A8
I then have the following pins linked to a single seven segment display:
A5 (a), A6 (b), A7 (c), B10 (d), B13 (e), B14 (f) and B15 (g).
The code I have below works when connected to my MacBook but when I disconnect it and then power it back up, it hangs on some of the switches. I can go through all the ‘gears’ and then it hangs on 6 or reverse.
I was hoping you kind people would help me out and let me know what I’m doing wrong.