This file contains hidden or 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
function serve() { | |
local host=`hostname` | |
local port="${1:-8888}" | |
(sleep 1 && open "http://${host}:${port}/")& | |
python -m SimpleHTTPServer "$port" | |
} |
This file contains hidden or 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
#include "mraa.hpp" | |
int main() | |
{ | |
// set GPIO digital pin "13" to be an output | |
mraa_gpio_context d_pin = mraa_gpio_init_raw(128); | |
mraa_gpio_dir(d_pin, MRAA_GPIO_OUT_HIGH); | |
// loop forever toggling the on board LED every second | |
for (;;) { |
This file contains hidden or 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
// example code of touch numbers (replaces getTouchNumber) | |
#include <Wire.h> | |
#include "Seeed_QTouch.h" | |
#include <SeeedOLED.h> | |
void setup() | |
{ | |
Serial.begin(9600); |
This file contains hidden or 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
/* global setInterval: false, setTimeout: false, clearInterval: false, clearTimeout:false, module: false, console: false */ | |
/** | |
* Module exports. | |
*/ | |
module.exports = LcdTextHelper; | |
/** | |
* LcdTextHelper constructor. |
This file contains hidden or 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'); | |
/* | |
If you get any mraa missing errors, run this on your board: | |
$ echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf | |
$ opkg update | |
$ opkg install libmraa0 | |
*/ | |
var LCD = require ('jsupm_i2clcd'); | |
/* |
This file contains hidden or 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
<script> | |
/** Convert a decimal number to a hex number. */ | |
function convertDecToHex(dec) { | |
var BASE = 16, | |
result = ''; | |
return getHex( dec ); | |
This file contains hidden or 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
int ledPin = 6; // Note that pin 13 on the Uno doesn't support PWM! | |
int brightness = 0; | |
int stepValue = 1; | |
void setup() { | |
pinMode(ledPin, OUTPUT); // sets the pin as output | |
} | |
void loop() { | |
This file contains hidden or 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
// YOUR ANGULAR SERVICE | |
clientApp.factory('Mongo', function($resource) { | |
// $resource(url[, paramDefaults][, actions]); | |
return $resource('http://localhost\\:8000/api/:action/:huddleId', | |
{ | |
action: '@action', | |
huddleId: '@huddleId' | |
}, | |
{ |
This file contains hidden or 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
#include <Servo.h> | |
//Servo | |
Servo armServo; | |
Servo baseServo; | |
const int ARM_SERVO = 9; | |
const int BASE_SERVO = 10; | |
// motor constants & limitations | |
const int minArmServoPos = 30; //don't go lower, will hit the base |
This file contains hidden or 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
#include <Servo.h> | |
//Servo | |
Servo armServo; | |
const int ARM_SERVO = 9; | |
Servo baseServo; | |
const int BASE_SERVO = 10; | |
// drawing variables |
NewerOlder