Adding Accelometer Function Acc_x Acc_y Acc_z For Python


#1

Hello,i am trying to move my toy car with Accelometer values.However,i cant take muse acc_x acc_y acc_z values with adding method. First part of code , i will analyze of values of acc and give direction…

How can i send ( acc_x acc_y acc_z) values to arduino for direction ( left-right-up-down…)

Controls the arduino (1.Part)

def sendToArduino(arduino):
while (True):
c = arduino.read()
reading = arduinoValues.get(block=True)
arduinoValues.queue.clear()
if(reading[0] …

def accelometer(path,args) (2.Part)
for i in xrange(len(args)):
if math.isnan(args[i]):
args[i] = 0
args.append(str(datetime.datetime.now()))
arduinoValues.put(args)

i add method for acc as below : (3.Part)
server.add_method("/muse/acc", ‘fff’, acc)