Close

Control via Serial

A project log for Tactile Tactical Interface

Heat/Cold/Vibration interface for situational awareness for firefighters, police, military, transportation, gaming, etc.

disasterarchydisasterarchy 08/27/2018 at 13:230 Comments

Now that the system is build and the vibration motors are all working well, I have added serial control so that I can have an external device tell the arduino when to activate the motors.  For this prototype I am going to add a Raspberry Pi Zero W which will communicate with the Arduino via serial and give it commands of when to activate the motors.  My arduino is setup so when it gets an "R" , "C" or "L" on the serial port it will activate the right center or left vibration motor respectively.  The arduino code is uploaded.  A python example is shown below for controlling it from my windows machine.

import serial
s = serial.Serial('COM4')
s.write('R')   #Activate Right Motor
s.write('L')  #Activate Left motor
s.write('C') #Activate Center Motor

s.write('RRCCLLLLCCRRCCLLLLCCRR')   #Back Massage
s.write('0')  # Off

Discussions