This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() { | |
switch (state){ | |
case ‘R’: | |
if( isr_flag == 1 ) { | |
delay(5000); | |
detachInterrupt(0); | |
handleGesture(); | |
digitalWrite(9, LOW); | |
isr_flag = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm WARN optional dep failed, continuing xpc-connection@0.1.4 | |
npm WARN engine node-hid@0.5.1: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.38","npm":"1.4.28"}) | |
npm WARN engine usb@1.1.1: wanted: {"node":">=0.12.x"} (current: {"node":"0.10.38","npm":"1.4.28"}) | |
- | |
> node-hid@0.5.1 install /home/root/bleno-master/node_modules/node-blink1/node_modules/node-hid | |
> node-pre-gyp install --fallback-to-build | |
make: Entering directory '/home/root/bleno-master/node_modules/node-blink1/node_modules/node-hid/build' | |
CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o | |
AR(target) Release/obj.target/hidapi.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mraa = require('mraa'); | |
var http = require('http'); | |
var port = 4242; | |
var led = new mraa.Gpio(12, true, true); | |
led.dir(mraa.DIR_OUT); | |
var server = http.createServer(function(req, res) { | |
res.writeHead(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple web server based on | |
* http://expressjs.com/en/starter/hello-world.html | |
* | |
* Prerequisites: | |
* - Node | |
* - Express (npm install express) | |
* | |
* To use, save as a file (e.g. SimpleServer.js) and run with: | |
* node SimpleServer.js /PATH/TO/WWW/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn the Beefcake Relay on for 2 seconds and off for 2 seconds | |
// | |
// Hardware: | |
// Relay Kit | Arduino | |
// -------------|--------- | |
// 5V | 5V | |
// CTRL | pin 7 | |
// GND | GND | |
// Pins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LED_N_SIDE 2 | |
#define LED_P_SIDE 3 | |
#define EMITTER 12 | |
#define LED 13 | |
#define CAL_N 100 | |
// Global variables | |
unsigned int threshold = 0; | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
while True: | |
display.scroll("Shawn") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 8-Channel Multiplexer Demo | |
* August 16, 2016 | |
* License: Public Domain | |
* | |
* Show PWM on 8 LEDs using 4 I/O pins and an analog input to | |
* adjust the PWM period. | |
* | |
* Hardware: | |
* Mux | Trimpot | Arduino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
while True: | |
if button_a.is_pressed(): | |
display.show(Image.HAPPY) | |
elif button_b.is_pressed(): | |
display.show(Image.SAD) | |
else: | |
display.show(Image.MEH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
while True: | |
if button_a.is_pressed(): | |
display.scroll("A") | |
elif button_b.is_pressed(): | |
display.scroll("B") | |
else: | |
display.show(Image.HAPPY) |
OlderNewer