Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python client for the Arduino simpleRPC protocol.

License

NotificationsYou must be signed in to change notification settings

jfjlaros/arduino-simple-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
https://readthedocs.org/projects/arduino-simple-rpc/badge/?version=stable

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.

Quick start

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.

Further reading

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

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp