KB2040 wont work with any board.* examples

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tristanH
 
Posts: 2
Joined: Fri Mar 17, 2023 10:21 pm

KB2040 wont work with any board.* examples

Post by tristanH »

So this is probably a super simple thing that im missing, however I cant work it out.
I purchased a few KB2040 to play around with.

I followed the CircuitPython guide for that board to get up and going (and even tried downloading their code packages), however no matter what example I use, if it references a pin, I get the following error

AttributeError: 'module' object has no attribute 'whateverpin'

Things like board.NEOPIXEL and board.D1 give the error, but board.LED and board.A1 seem to work
I have tried both circuitpython 7.3.3 and 8.0.4 and I have confirmed the pin names for codepython for this board are correct.

Any help would be appreciated

User avatar
alpierce
 
Posts: 206
Joined: Mon May 13, 2013 2:44 am

Re: KB2040 wont work with any board.* examples

Post by alpierce »

Which circuitpython .uf2 file did you load ? It sounds like the board description is wrong. If you go into the REPL what does the description say? If you type

load board
dir(board)

What pins show up?

User avatar
tristanH
 
Posts: 2
Joined: Fri Mar 17, 2023 10:21 pm

Re: KB2040 wont work with any board.* examples

Post by tristanH »

alpierce wrote: Sat Mar 18, 2023 12:40 am Which circuitpython .uf2 file did you load
Sorry for the slow response, ended up in hospital after i posted that haha.
You were spot on, i was using the incorrect .uf2 file even though i downloaded the one for the board from the tutorial, but after going direct to circuitpython and downloading the correct one, things are working much better.

Thanks for your help

User avatar
alpierce
 
Posts: 206
Joined: Mon May 13, 2013 2:44 am

Re: KB2040 wont work with any board.* examples

Post by alpierce »

Glad to hear it’s working and that you’re ok. In my post I should have written

import board
dir(board)

To get the pins list

Happy hacking

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

Return to “Adafruit CircuitPython”