Lost board and digitalio files

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pridgenr
 
Posts: 3
Joined: Fri Mar 17, 2023 8:32 am

Lost board and digitalio files

Post by pridgenr »

I have just started working with Circuit Playground Express, and seem to have accidentally deleted my board and digitalio files, resulting in errors. Where do I find replacements to download?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lost board and digitalio files

Post by dastels »

There are no board and digitalio files, those modules are part of the CircuitPython runtime.

What errors are you getting?

Dave

User avatar
pridgenr
 
Posts: 3
Joined: Fri Mar 17, 2023 8:32 am

Re: Lost board and digitalio files

Post by pridgenr »

import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
led.value = True
time.sleep(1)
led.value = False
time.sleep(2)

When using VSCode to copy the blink sample code from the webpage, I get the message. "Import "board" could not be resolved". Is this just a quirk of CircuitPython on VSCode?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lost board and digitalio files

Post by dastels »

Are you sure you're running the code on a CircuitPython device, or something with Blinka?

Dave

User avatar
pridgenr
 
Posts: 3
Joined: Fri Mar 17, 2023 8:32 am

Re: Lost board and digitalio files

Post by pridgenr »

Its a Circuit Playground Express running version 8.something. It shows in File Manager as F:CIRCUITPY. This program runs, and can be tweaked to change the blink rate. However, I'm puzzled why it has imports like board and digitalio if they're not needed. I wanted to be sure I hadn't deleted something by mistake and messed things up.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lost board and digitalio files

Post by dastels »

They are needed in the code you posted.

So it sounds like VSCode is complaining about the board module. Which makes sense since there's nothing for it to find/resolve.

This might help: https://marketplace.visualstudio.com/it ... cuitpython

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”