Crickit Circuit Playground Express Issues

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
tcooper
 
Posts: 54
Joined: Mon Apr 23, 2012 10:31 pm

Crickit Circuit Playground Express Issues

Post by tcooper »

I'm using the Circuit Playground Express with the Crickit board. I am using the CPX Special Build of CircuitPython. Here is my basic code example (two bumper switches to control the motors):

Code: Select all

import time
from adafruit_crickit import crickit

# For signal control, we'll chat directly with seesaw, use 'ss' to shorted typing!
ss = crickit.seesaw

# Two buttons are pullups, connect to ground to activate
BUTTON_1 = crickit.SIGNAL1  # button #1 connected to signal port 1 & ground
BUTTON_2 = crickit.SIGNAL2  # button #2 connected to signal port 2 & ground

ss.pin_mode(BUTTON_1, ss.INPUT_PULLUP)
ss.pin_mode(BUTTON_2, ss.INPUT_PULLUP)

# make two variables for the motors to make code shorter to type
motor_1 = crickit.dc_motor_1
motor_2 = crickit.dc_motor_2

while True:
    motor_1.throttle = 0.4
    motor_2.throttle = 0.4
    
    if not ss.digital_read(BUTTON_1):
        print("Button 1 pressed")
        motor_1.throttle = -1
        motor_2.throttle = -0.5
        time.sleep(0.3)

    if not ss.digital_read(BUTTON_2):
        print("Button 2 pressed")
        motor_1.throttle = -0.5
        motor_2.throttle = -1
        time.sleep(0.3)
I can get this to run, but after a few minutes I get the following error:

Code: Select all

code.py output:
Traceback (most recent call last):
  File "code.py", line 2, in <module>
  File "adafruit_crickit.py", line 402, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring
Any ideas what is going on here?

User avatar
tcooper
 
Posts: 54
Joined: Mon Apr 23, 2012 10:31 pm

Re: Crickit Circuit Playground Express Issues

Post by tcooper »

I added in a delay in the main loop, and now getting this error after clicking one of the bumper buttons:

Code: Select all

Button 1 pressed
Traceback (most recent call last):
  File "code.py", line 29, in <module>
  File "adafruit_seesaw/seesaw.py", line 211, in digital_read
  File "adafruit_seesaw/seesaw.py", line 216, in digital_read_bulk
  File "adafruit_seesaw/seesaw.py", line 456, in read
  File "adafruit_seesaw/seesaw.py", line 475, in write
OSError: [Errno 5] Input/output error

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

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