Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
misoji engineer
Published

Raspberry Pi and DRV8833 Test

Controlled DC motor by Raspberry Pi and DRV8833

BeginnerProtip2 hours384
Raspberry Pi and DRV8833 Test

Things used in this project

Hardware components

Raspberry Pi 4 Model B
Raspberry Pi 4 Model B
×1
DRV8833 PCB
×1
DC motor (generic)
×1

Story

Read more

Schematics

DC motor work with DRV8833 and 4.5V

Code

DRV8833_test

Python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(27,GPIO.OUT)
GPIO.setup(22,GPIO.OUT)

for i in range(2):
    
    GPIO.output(17, False); GPIO.output(27, True); GPIO.output(22, True)
    time.sleep(3)
    
    GPIO.output(17, True); GPIO.output(27, False); GPIO.output(22, True)
    time.sleep(3)
    
GPIO.cleanup()

Credits

misoji engineer
16 projects • 7 followers

Comments