Thursday, July 25, 2013

Our Code

rom subprocess import call
call("echo uart1 > /sys/devices/bone_capemgr.8/slots", shell=True)
import serial
import sys
import time

serialport = serial.Serial("/dev/ttyO1", 9600, timeout=1)
response1 = ''
response2 = ''
s= ''
serialport.write("AT Z\r")
serialport.write("AT SP 0\r")

serialport.write("ATI\r")
response1 = serialport.readline(16)
sys.stdout.flush()

serialport.write("AT@1\r")
response2 = serialport.readline(26)
print response1
sys.stdout.flush()

print response2

sys.stdout.flush()

serialport.write("01 0D \r")
speed_hex="41 0D 15"
speed_hexx = serialport.readline().split(' ')
speed = float(int('0x'+speed_hex[6:8], 0 ))
print 'Speed: ', speed, 'km/h'

sys.stdout.flush()

serialport.write("01 0C \r")
time.sleep(.5)
rpm_hex="41 0C 28 92"
rpm_hexx = serialport.readline().split(' ')
print rpm_hex,' zero'
print rpm_hex[9:11],'0'
rpmA = float(int('0x'+rpm_hex[6:8], 0 ))
rpmB = float(int('0x'+rpm_hex[9:11], 0 ))
print rpmA,' Value of RPMA hex'
print rpmB,' Value of RPMB hex'
rpm = ((rpmA*256)+rpmB)/4

print 'Tach: ', rpm, 'rpm'

Maine Fab team photo

Team with out patient


So far....

Our project is what we can call complete.  Please watch this video here for a rundown of what we have created Here.