GithubHelp home page GithubHelp logo

ca4ti / virtual-gpio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a33j/virtual-gpio

0.0 1.0 0.0 330 KB

Arduino as a "GPIO" device attached to PC or Raspberry Pi

C++ 43.65% Python 27.99% C 15.12% Arduino 13.23%

virtual-gpio's Introduction

virtual-GPIO

Arduino as a "GPIO" device attached to PC or Raspberry Pi, which run python control script.

Give your Raspberry Pi precise counters, easy IR receiver, analog inputs. Give your PC a virtual GPIO on a USB port. Add SPI, I2C, analog & digital pins, servo control, etc.

Supported:

  • GPIO digital in/out D2-D13 A0-A5
  • PWM out 8bit - 6 pins
  • high performance PWM option, or as pulse generator 1Hz to 1MHz
  • analog Read 10bit 8 pins
  • SPI master, multiple choice for CE pin
  • pulseout 1-250 uSec [arduino coded]
  • pulsein 0-25 mSec [arduino coded, not native arduino version]
  • servo pins3-10
  • ir remote rx
  • SMBus / I2C master
  • 2 software (arduino-polled) counters / quadEncoders
  • Hardware pin counter x 1 on d5
  • Twin INT0/INT1 counters on d2/d3
  • AVR raw register access
  • Auto-find for PC end serial port

Generally about 800 instructions/sec achievable on PC, depending on call type, and 200/sec on rPi.

"virtGPIO.py" is the PC end of "virtual-gpio", ie using arduino as a GPIO device on PC (python on linux). This module uses USB serial to power and control the arduino.

The ARDUINO end is the sketch "VirtGPIO.ino". Shields, attached modules etc are NOT generally coded at the arduino end. Such support is to be coded at the PC end. (Exceptions: infrared remote codes reader, and background stepper) Atmega328 is assumed.

Main files:

  • VirtGPIO.ino (and its acompanying library files) essential - sketch for Arduino end.
  • virtGPIO.py essential library at Raspberry Pi or PC.
  • collection of example python files demonstrating use of virtual GPIO.

Documentation on GPIO calls: See http://virtgpio.blavery.com

  • Changes made V0.9 -> v0.9.5 :
  • Added serialConfig.py for port settings
  • Sonar removed from virtGPIO core, out to simple example script
  • SPI devices get individual control of mode
  • i2c - option to disable arduino's internal pullups
  • SPI.xfer2() out to 80 chars, and added unlimited SPI.writebytes()
  • Improved RPI syntax compatibility
  • Now Python 2.7 / Python 3.3 compatible

DISCLAIMER on the associated libraries (mcp23017, lcd16x2, nokia5110, nrf24, tft144) - these are a work in progress, and recently have been exercised more against virtual-GPIO than Raspberry Pi. There are sure to be various updates/corrections to those. The virtual-GPIO core library itself (v0.9.5) should be fairly intact. BL 5 Nov 2014.

V0.9.5 November 2014

virtual-gpio's People

Watchers

 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.