Skip to content

Arduino Prototyping API library used to quickly prototype an Arduino based application

Notifications You must be signed in to change notification settings

linedubeth/Python-Arduino-Prototyping-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Python Arduino Prototyping API (version: 0.1)
=====================================================

The 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)

Digital I/O functions:
1.) Arduino.setHigh(pin_number)
2.) Arduino.setLow(pin_number)
3.) Arduino.getState(pin_number)
    getState() returns true if pin state is high, else it returns false.

Analog I/O functions:
1.) Arduino.analogRead(pin_number)
    returns the analog value
2.) Arduino.analogRead(pin_number, value)
    sets the analog value

Misc functions:
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 Arduino

import 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)
    i+=1

About

Arduino Prototyping API library used to quickly prototype an Arduino based application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published