Skip to content

nimblemo/firebox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FireBox

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)

Features:

  • Serch device on a name
  • Packet transmission commands to device

Import library

import firebox as fb

Find device

serPort = fb.findDevice('stimulator')

Request body

data = []
data.append("<fire,200,5>")

The request concluded in stop characters ** <...> ** it takes 3 arguments, first is a string, other is integers.

Command

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
===========

Methods.

List of ports
serialPorts()
Open port
openSerial(serPort, baudRate)
send message on to the device
sendToArduino(sendStr)
recive message
recvFromArduino()
waiting device
waitForArduino()
Send message
sendMessage(serPort,td, baudRate=19200)
Find device
findDevice(devName,baudRate=19200,numDev=0)

About

Python to Arduino connector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages