#I2C Error in Adafruit DC and Stepper Motor HAT for Raspberry Pi
1 messages · Page 1 of 1 (latest)
I have also been advised to use alternate code.
Define kit = MotorKit(i2c=board.I2C(), address = 96)
Soldering.
Tried using address as parameter
Code:
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""Simple test for using adafruit_motorkit with a DC motor"""
import time
import board
from adafruit_motorkit import MotorKit
kit = MotorKit(i2c=board.I2C(), address = 0x70)
kit.motor1.throttle = 1.0
time.sleep(0.5)
kit.motor1.throttle = 0
————
Here is me running the blinka test code
This is the code:
import board
import digitalio
import busio
print("Hello blinka!")
# Try to great a Digital input
pin = digitalio.DigitalInOut(board.D4)
print("Digital IO ok!")
# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")
# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")
print("done!")
you need to use backticks, not smartquotes to get the code blocks to format correctly
i looked at your screenshots, and for some reason the Python code isn't detecting the I2C devices that your i2cdetect commands are, which is kind of odd. i haven't touched Raspberry Pi in quite a while, so maybe someone who's more familiar with it can help
Okay, I’ll try #help-with-linux-sbcs
you can link the thread to make it easier to find when you do post there
Attempted reflow. Same issue
@novel sedge , may I have help?
do you know how to run python interactively? to type commands in REPL?
Do you mean typing $ python3 into the console to run code there?
And for REPL, I'm not familiar with that
yep
that's it
REPL is just the >>> prompt
run python3 and the try the command interactively
import board
from adafruit_motorkit import MotorKit
kit = MotorKit(i2c=board.I2C())
one line at a time?
yep
unfortunately it's likely still a connection issue
that Remote I/O error is pretty much always connection related
is it still showing up reliably in a scan?
Are there specific pins I should focus on?
these two
try scanning also via REPL
exit and relaunch python3
then:
import board
i2c = board.I2C()
i2c.try_lock()
i2c.scan()
syntax?
Is that supposed to detect i2c addresses?
How come that is empty but the other command returns 60 and 70 address?
not sure. but potentially another indication of marginal connections.
Could I test I2C with another device or does it have to designed for it?
do you have some other I2C device?
I'm not sure what that may be. The only HAT I have is this Motor HAT. I've got an assortment of components like Ultrasound sensors and small LCD screens
I also have a Pi Pico and an RPi 4
It's getting late so I'll respond fully tomorrow but they are these
not i2c
hahaahha I realised I had plugged in the HAT with only one row of GPIO pins when doing those tests
Same error.
Yesss!!!
Cater
looks like addresses are showing up in REPL scan now. are things working now?