Hello everyone, I am working on a project that a previous student left half done and the professor wants me to get it up and running except I there is no documentation for it and all there is no working code from what I can tell.
The part of the project I am stuck on is I am using a raspberry pi 3 B and this motor controller from sparkfun
https://www.sparkfun.com/products/13911
This is the fist time I work with the serial pins on any Micro controller and I have the whole System hooked up right to the best of my knowledge and I think it is my code is what is wrong
Here is my code
#!/usr/bin/env python
from time import sleep
import sleep
ser = serial.Serial(
port=' /dev/ttyAMA0'
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
)
x = 0
while(x<1):
ser.write('M0F70\n')
ser.write('M1F70\n')
ser.write('E\n')
sleep(2)
print ('stop')
ser.write('D\n')
sleep(2)
x +=1
This is the code I could not copy and paste so I could not use tab for the arguments in the loops, I just used 5 spaces if you copy this code you may have to change that back into tabs when you put it in your script.**
This code runs but nothing is happening with the motors im positive it is not to do with the hardware. So I am not sure what I am doing wrong I cant seem to find any tutorial online to to work with a motor controller like this and using serial ports (RX,TX Pins).