Git Product home page Git Product logo

arduino's Introduction

Arduino

SPI Video

Use secondary SPI interface as video shift register: https://youtu.be/vEfm9Pm9MkI

Esplora Processing Interface

Arduino, Python, and Processing library source code for tethering the Esplora to a PC running Python/Processing.

Download the Esplora package for Processing

  1. Open http://github.com/dschmenk/Arduino in Safari.
  2. Click on 'Download ZIP' on right side of screen
  3. Drag the Downloads/Arduino-master folder to the Documents/Processing folder.

Using libraries and modules

Start a new sketch, add the serial port library, import the Esplora module and see how easy it is to use. From the Processing menu, click through "Sketch/Add File..." and add the "Arduino-master/Processing/Esplora/Esplora_Processing.py" file.

A simple example

add_library('serial')
from Esplora_Processing import Esplora

def setup():
    Esplora.open(Serial)
    
def draw():
    background(map(Esplora.readSlider(), 1023, 0, 0, 255))

Programming the Esplora firmware

If your Esplora needs to be programmed with the serial protocol firmware for use with Python, open the SerEsplora project in the Arduino IDE and update the Esplora.

Basic API:

Esplora.open(Serial): Open Esplora connection for use
	return: None

Esplora.close(): Close Esplora connection
	return: None

Esplora.writeLED(red, green, blue): Write RGB (or brightness) to LED
	return: None

Esplora.writeBuzzer(hertz, duration): Write buzzer tone
	return: None

Esplora.readJoystick(): Read joystick position
	return: [-512..511, -512..511]

Esplora.readAccelerometer(): Read accelerometer values
	return: [-512..511, -512..511, -512..511]

Esplora.readButtons(): Read 4 diamond pad buttons and joystick button
	return: [0..1, 0..1, 0..1, 0..1, 0..1]

Esplora.readSlider(): Read slider value
	return: 0..1023

Esplora.readLightSensor(): Read light level
	return: 0..1023

Esplora.readMicrophone(): Read sound level
	return: 0..1023

Esplora.readTempC(): Read temperature in Celsius
	return: -100..200

Esplora.readTempF(): Read temperature in Fahrenheit
	return: -100..200

Low-Level API:

Esplora.readDigital(pin): Read the value on a digital pin
	return: 0..1

Esplora.readAnalog(pin): Read the value on an analog pin
	return: 0..255

Esplora.writeDigital(pin, value): Write a value to a digital pin
	return: None

Esplora.writePwm(pin, value): Write a value to an analog (PWM) pin
	return: None

TFT API (for optional Esplora TFT screen):

Esplora.tftSize(): Read the size of the TFT display
	return: [tftWidth, tftHeight]

Esplora.tftBackground(red, green, blue): Fill TFT background with color
	return: None

Esplora.tftFill(red, green, blue): Set fill color for 2D primitives
	return: None

Esplora.tftStroke(red, green, blue): Set stroke color for 2D primitives
	return: None

Esplora.tftNoFill(): Don't fill 2D primitives
	return: None

Esplora.tftNoStroke(): Don't outline 2D primitives
	return: None

Esplora.tftRect(xpos, ypos, width, height): Draw a rectangle
	return: None

Esplora.tftLine(x1, y1, x2, y2): Draw a line
	return: None

Esplora.tftCircle(xpos, ypos, radius): Draw a circle
	return: None

Esplora.tftText(string, xpos, ypos): Draw a text string
	return: None

Esplora.tftTextSize(size): Set the text size
	return: None

arduino's People

Contributors

dschmenk avatar highlander-robotics 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.