I recently purchased 2x of the Adafruit DC & Stepper Motor Bonnet for Raspberry Pi PID: 4280 as well as a Pimoroni pHAT Stack for Raspberry Pi PID: 3742.
I am attempting to drive a 12v DC motor with a 12v power supply. However, when I send the "throttle" command to the motor, nothing happens.
The 12v power supply was measured by a multimeter to be 12.3v. The green LED on the motor hat is on.
I have verified that i2c is on. This is the output of i2c detect:
Code: Select all
sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
Code: Select all
Hello blinka!
Digital IO ok!
I2C ok!
Traceback (most recent call last):
File "/home/hapi/hapi-water/blinka-test.py", line 16, in <module>
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/busio.py", line 289, in __init__
self._spi = _SPI(portId)
File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in __init__
self._spi = spi.SPI(device=(portid, 0))
File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/Adafruit_PureIO/spi.py", line 167, in __init__
raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist
When I run the following test code:
Code: Select all
# 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(address=60)
print(kit)
print("Test!")
i=0
while i < 10:
kit.motor1.throttle = 1
time.sleep(1)
print(i)
kit.motor1.throttle = 0
i += 1
print('done')
Code: Select all
<adafruit_motorkit.MotorKit object at 0x7f8b383fd0>
Test!
0
1
2
3
4
5
6
7
8
9
done
I have tried this with 2 separate bonnets and it seems unlikely that 2 separate bonnets would both have a hardware problem, so I am assuming something about my setup is incorrect.
Any idea what next steps I should try?
Setup image attached.