Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HashNuke/Python-Arduino-Prototyping-API
Helps you to quickly prototype Arduino programs, without having to repeatedly load the program to the Arduino board
https://github.com/HashNuke/Python-Arduino-Prototyping-API
Last synced: 3 months ago
JSON representation
Helps you to quickly prototype Arduino programs, without having to repeatedly load the program to the Arduino board
- Host: GitHub
- URL: https://github.com/HashNuke/Python-Arduino-Prototyping-API
- Owner: HashNuke
- License: mit
- Created: 2009-08-23T14:22:04.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2012-06-12T21:08:15.000Z (over 12 years ago)
- Last Synced: 2024-07-15T15:42:16.787Z (4 months ago)
- Language: Python
- Homepage: http://github.com/hashnuke/Python-Arduino-Prototyping-API
- Size: 168 KB
- Stars: 148
- Watchers: 21
- Forks: 24
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: MIT-license.txt
Awesome Lists containing this project
README
# Python Arduino Prototyping API (version: 0.5)
> © 2009-2010 Akash Manohar J
> under the MIT LicenseThe Python Arduino Prototyping API helps you to quickly prototype Arduino programs,
without having to repeatedly load the program to the Arduino board.#### Setup:
1. Load prototype.pde onto your Arduino dev board.
2. Import the arduino lib in your python script.## Methods
*Arduino.output(list_of_output_pins)* - set the output pins
**Digital I/O**
1. *Arduino.setHigh(pin_number)*
2. *Arduino.setLow(pin_number)*
3. *Arduino.getState(pin_number)*
4. *Arduino.getState()* - returns true if pin state is high, else it returns false.**Analog I/O**
1. *Arduino.analogRead(pin_number)* - returns the analog value
2. *Arduino.analogWrite(pin_number, value)* - sets the analog value**Misc**
1.) *Arduino.turnOff()* - sets all the pins to low state
2.) *Arduino.close()* - closes serial connection. Using this makes sure that you won't have to disconnect & reconnect the Arduino again to recover the serial port.
## Usage example
#the blink program
#import the lib
from arduino import Arduinoimport time
#specify the port as an argument
my_board = Arduino('/dev/ttyUSB1')#declare output pins as a list/tuple
my_board.output([11,12,13])#perform operations
i=0
while(i<10):
my_board.setHigh(13)
time.sleep(1)
my_board.setLow(13)
time.sleep(1)
i+=1