The boards are flashed with Espruino. Install the CP2102 driver and Espruino IDE from the Chrome extensions store. See Anna's blog for more details.
Use the GPIO pin numbers in the code e.g. pin 4 not D2.
[ | |
{ | |
"id": "bb87c61.ab4c438", | |
"type": "homekit-service", | |
"z": "35c3d6b9.82903a", | |
"accessory": "dcd28ec5.c286d", | |
"name": "Door Motion Sensor", | |
"serviceName": "MotionSensor", | |
"x": 603.5, | |
"y": 202, |
The boards are flashed with Espruino. Install the CP2102 driver and Espruino IDE from the Chrome extensions store. See Anna's blog for more details.
Use the GPIO pin numbers in the code e.g. pin 4 not D2.
NodeRover kits for NodeBots day Brisbane
Build instructions are here: https://t.co/x3J8mI0ddU
import pyfirmata | |
import math | |
board = pyfirmata.Arduino("/dev/ttyACM0") | |
# connect piezo to pin 9 to use PWM | |
SENSOR_PIN = 0 | |
PIEZO_PIN = board.get_pin('d:9:p') | |
it = pyfirmata.util.Iterator(board) |
// pwm pins for red, green and blue | |
int rled = 9; | |
int gled = 10; | |
int bled = 11; | |
void setup() { |
#include <Wire.h> | |
// pwm pins for red, green and blue | |
int rled = 9; | |
int gled = 10; | |
int bled = 11; | |
char currentColor = 'r'; | |
/* | |
TODO: support hex values for rgb |
int speakerPin = 9; | |
int played = 0; | |
int cicada_length = 331; // the number of notes | |
char cicada_notes[] = " 1212121212121212121212121211212 1212121212121212121212121211212 1212121212121212121212121211212 1212121212121212121212121211212 1212121212122121212121212122111 1212121212121212121212121211212 1212121212121212121212121211212 1212121212121212121212121211212 1212121212121212121212121211212 1212121212122121212121212122111 "; // a space represents a rest | |
int cicada_beats[] = {1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1, | |
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
1,2,1,1,1,1,1,1, |