UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
MIT License
662
stars
411
forks
source link
Python LED sample does not work due to mixup between module alias name and an object name #614
Traceback (most recent call last):
File "led.py", line 46, in
main()
File "led.py", line 29, in main
led = led.Led(2)
UnboundLocalError: local variable 'led' referenced before assignment
Note that "led" is used both as a module alias in the import command and as an object name in the assignment command. Consider renaming one of these "led"s with a distinct name
In this file: https://github.com/intel-iot-devkit/upm/blob/master/examples/python/led.py the following causes python to error out:
from upm import pyupm_led as led
...
led = led.Led(2)
with the following error:
Note that "led" is used both as a module alias in the import command and as an object name in the assignment command. Consider renaming one of these "led"s with a distinct name