- Notifications
You must be signed in to change notification settings - Fork7
Python client for the Arduino simpleRPC protocol.
License
jfjlaros/arduino-simple-rpc
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This library provides a simple way to interface toArduino functions exportedwith thesimpleRPC protocol. The exported method definitions are communicatedto the host, which is then able to generate an API interface using thislibrary.
Features:
- User friendly API library.
- Command line interface (CLI) for method discovery and testing.
- Function and parameter names are defined on the Arduino.
- API documentation is defined on the Arduino.
- Support for disconnecting and reconnecting.
- Support for serial and ethernet devices.
Please seeReadTheDocs for the latest documentation.
Export any function e.g.,digitalRead() anddigitalWrite() on theArduino, these functions will show up as member functions of theInterfaceclass instance.
First, we make anInterface class instance and tell it to connect to theserial device/dev/ttyACM0.
>>>fromsimple_rpcimportInterface>>>>>>interface=Interface('/dev/ttyACM0')
We can use the built-inhelp() function to see the API documentation of anyexported method.
>>>help(interface.digital_read)Helponmethoddigital_read:digital_read(pin)methodofsimple_rpc.simple_rpc.InterfaceinstanceReaddigitalpin. :argintpin:Pinnumber. :returnsint:Pinvalue.
All exposed methods can be called like any other class method.
>>>interface.digital_read(8)# Read from pin 8.0>>>interface.digital_write(13,True)# Turn LED on.
For more information about the host library and other interfaces, please seetheUsage andLibrary sections.
About
Python client for the Arduino simpleRPC protocol.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.