Im new to Thonny and am trying to get a script working but there is an issue when i try running it it states:
%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: can't import name pin
I think i need to import pin but where and how do I accomplish this? Following is the very simple script I am trying to run. I do have micropython loaded on the tiny2040 already.
from machine import pin
from time import sleep
ledR = Pin(18,Pin.OUT)
ledG = Pin(19,Pin.OUT)
ledB = Pin(20,Pin.OUT)
ledR.on(); ledG.on(); ledB.on();
while 1:
sleep(0.5)
ledR.off(); ledG.on(); ledB.on(); #Red on
sleep(0.5)
ledR.on(); ledG.off(); ledB.on(); #Green on
sleep(0.5)
ledR.on(); ledG.on(); ledB.off(); #Blue on
I have tried a seperate script and had the same issues with a module called board.
-Brian-