DotStar Example error

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
Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

DotStar Example error

Post by Ianlinsdell »

I just recieved a IitsyBitsy M0 Express.

I usually use C/C++ but would like to give CircuitPython a try.

I have managed to get the Python Keyboard and red LED example working, but when I try to use the DotStar, I get the following error message at the line:
led = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1)

Any help please?

----
Traceback (most recent call last):
File "main.py", line 7, in <module>
File "adafruit_dotstar.py", line 128, in __init__
TypeError: function missing 1 required positional arguments

---
Example is from .pdf guide
---

Code: Select all

import time
import board
 
# For Trinket M0, Gemma M0, ItsyBitsy M0 Express, and ItsyBitsy M4 Express
import adafruit_dotstar
led = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1)
 
led.brightness = 0.3
 
while True:
    led[0] = (255, 0, 0)
    time.sleep(0.5)
    led[0] = (0, 255, 0)
    time.sleep(0.5)
    led[0] = (0, 0, 255)
    time.sleep(0.5)

User avatar
danhalbert
 
Posts: 4655
Joined: Tue Aug 08, 2017 12:37 pm

Re: DotStar Example error

Post by danhalbert »

I tried this myself with CircuitPython 6.2.0 and the latest libraries, and it worked, so I think you may simply have a version skew problem. Could you try cleaning out lib/ on your board and installing the latest adafruit_dotstar.mpy, installing CircuitPython 6.2.0, and removing adafruit_pypixel if it is there?

User avatar
Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

Re: DotStar Example error

Post by Ianlinsdell »

Humm , thanks but already tried the following.

1. Downloaded latest adafruit library bundle.

2. Deleted all files in my itsybitsy m0 express lib directory.
The mu editor terminal made me do this anyway as the serial console said
Mpy s were out of date.

As i mentioned the keyboard emu example and regular red led examples work fine.

Only thing im not sure about is that my board arrived from adafruit today, when i enter repl in serial console it says CircuitPython 4.2.1 ?

User avatar
Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

Re: DotStar Example error

Post by Ianlinsdell »

OK got it working now thanks,

The issue was that the ItsyBits was shipped with an old version of CircuitPython 4.2.1.

When i tried to update using x6 .u2 the first time by double clicking reset, it mounted the other mount point TINYUBS? but windows started installing driver and ItsyBitsy rebooted
back to CIRCUITPY mount point without updating .u2.

This time since TINYUSB mount point driver was already installed I was able to update to x6 .u2 successfully and Mu Serial editor now reports CircuitPythpn 6.x

RGB led now work with same code shown above

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

Return to “Adafruit CircuitPython”