microsoft/vscode-python-devicesimulator

microbit: `[ERROR] name 'pin0' is not defined`

gabrielle-ohlson opened this issue · 0 comments

When trying to run a micropython file using this extension and referencing any of the pins (e.g., pin0), I receive the following error in the console:

[ERROR] name 'pin0' is not defined

Here's an example of code that produces this error:

from microbit import *
import microbit

while True:
	if pin0.read_digital():
		display.scroll("Hello World!")

and the resulting error:

[ERROR] name 'pin0' is not defined 
	Traceback of code execution : 
	  File "/home/gohlson/code/micro-bit/main.py", line 5, in <module>
    if pin0.read_digital():