led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
print("Hello back to you!")
led.value = Tru
time.sleep(1)
led.value = False
time.sleep(1)
Save your file. You will notice that your red LED will stop blinking, and you may have a
colored status LED blinking at you. This is because the code is no longer correct and
can no longer run properly. You need to fix it!
Usually when you run into errors, it's not because you introduced them on purpose.
You may have 200 lines of code, and have no idea where your error could be hiding.
This is where the serial console can help. Let's take a look!
The Traceback (most recent call last): is telling you that the last thing it was
able to run was line 10 in your code. The next line is your error: NameError: name
'Tru' is not defined . This error might not mean a lot to you, but combined with
knowing the issue is on line 10, it gives you a great place to start!
Go back to your code, and take a look at line 10. Obviously, you know what the
problem is already. But if you didn't, you'd want to look at line 10 and see if you could
figure it out. If you're still unsure, try googling the error to get some help. In this case,
you know what to look for. You spelled True wrong. Fix the typo and save your file.
©Adafruit Industries Page 56 of 263