This is simple blink sketch from Circuit Python Tutorial somewhere.
I amd running it on a Tiny2040 from Pimoroni. With the sketch timing as shown the LED GP20 flashes on for a very short period (0.01) and off for a long period (1.0).
I was wondering why that is…My reading of the code is Toggle on (True) and stay on during sleep (1.0) then Toggle off (False) and stay off during sleep (0.01)…???
Is the code not read sequential…???
led = digitalio.DigitalInOut(board.GP20)
led.direction = digitalio.Direction.OUTPUT
led.value = True
led.value = False
It’s working properly!
The RGB LED on GP’s 18,19 and 20 are common anode - connected to 3.3v.
A low voltage (logic FALSE) is required to turn them on.
A high voltage (logic TRUE) will turn them off.
You have to use ‘reverse’ logic with these LEDs.
If you put an external LED with cathode wired to ground and anode to GPIO pins (as you’d normally expect them to be wired) then it would work as you expected.
OK, Thanks… I never thought of that…???..It must be the only Micro wired like that for the “Built_in” Leds. I dont think even the pico is like that. So its reverse logic for these LEDs and Normal (True = High = On = 1) for all other pins 1 to 16…
When I look at the Pimoroni shop page for the TINY2040 and I take out my Magnifying glass I can see there is an “Active Low” Bar above all these pins… Is there actual physical access to pins 18,19,20,23 RUN, & 23. or just via program.???
Are there any reference manuasl for Tiny2040 and RPi Pico giving the info for Modules, Boards, Pins, Python functions, syntax etc all in one place.
For example… where does it say how to light up the Blue LED…??
If I go REPL, I have to import “modules”, then pick one…it might be board…??..then dir board.?? …and get a list of pin numbers. One is called “LED” …so it might be a good idea to pick that.and put that in my code…but it does not work…???..by good luck I seen on the pinout diag. that Blue was pin 20… so tried that and it worked…I dodnt catch on that it was reverse logic at that stage.
Just received my Tiny2040 and am trying to get this LED Script to work but not having any luck. I have MicroPython v1.20.0 on 2023-04-26; Raspberry Pi Pico with RP2040 loading using the uf2 file. Thonny is seeing the board correctly however when I attempt to run it i am getting the following error:
%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File “”, line 1, in
ImportError: no module named ‘board’
So it doesnt find a package called board. I went to look for a package called board and the Thonny package installer doesnt have anything labeled as such. Assistance would be appreciated…Thank You