Giter Club home page Giter Club logo

python-arduino-prototyping-api's Introduction

Python Arduino Prototyping API (version: 0.5)

© 2009-2010 Akash Manohar J [email protected] under the MIT License

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) - 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.analogRead(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 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)
        time.sleep(1)
        i+=1

python-arduino-prototyping-api's People

Contributors

hashnuke avatar

Stargazers

Budi Khoirudin avatar

Watchers

Budi Khoirudin avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.