Skip to content

Instantly share code, notes, and snippets.

View pearlchen's full-sized avatar

Pearl Chen pearlchen

  • Make This Studio
  • Toronto, ON
View GitHub Profile
@pearlchen
pearlchen / blinkTest.cpp
Last active August 29, 2015 14:25
2 different versions of the bare minimum code required to blink an LED on pin 13 (aka J17-14) using an Intel Edison and C++.
#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 (;;) {
function serve() {
local host=`hostname`
local port="${1:-8888}"
(sleep 1 && open "http://${host}:${port}/")&
python -m SimpleHTTPServer "$port"
}