Python library for connecting PC to Arduino through Serial port
import firebox as fb
serPort = fb.findDevice('stimulator')
if(serPort):
data = []
data.append("<fire,200,5>")
fb.sendMessage(serPort,data)
- Serch device on a name
- Packet transmission commands to device
import firebox as fb
serPort = fb.findDevice('stimulator')
data = []
data.append("<fire,200,5>")
The request concluded in stop characters ** <...> ** it takes 3 arguments, first is a string, other is integers.
fb.sendMessage(serPort,data)
If the data transfer is successful, you can to see next message in console,
===========
Sent from PC -- LOOP NUM 0 TEST STR <fire,200,5>
Reply Received: fired
Timing: 0.213000059128
===========
serialPorts()
openSerial(serPort, baudRate)
sendToArduino(sendStr)
recvFromArduino()
waitForArduino()
sendMessage(serPort,td, baudRate=19200)
findDevice(devName,baudRate=19200,numDev=0)