Skip to content

Instantly share code, notes, and snippets.

View jmsaavedra's full-sized avatar

Joe Saavedra jmsaavedra

View GitHub Profile
@jmsaavedra
jmsaavedra / info.md
Last active November 6, 2015 21:09
startup script resources for ubuntu

adding an init.d script:

  1. look at /etc/init.d/skeleton for the script template
  2. after creating your own, chmod a+x myscript
  3. sudo mv myscript /etc/init.d
  4. update-rc.d myscript.....tba...

OR

...tba...

@jmsaavedra
jmsaavedra / simpleserial.ino
Created October 3, 2015 22:18
Teensy Serial Controller
/******
* Teensy connected to Powerswitch Tail 2
*/
#define PST_1 3 //powerswitch tail pin 1
#define PST_2 4 //powerswitch tail pin 2
#define LED 13 //teensy 3.0 on-board LED
void setup() {
Serial.begin(9600);
import java.io.*;
import java.util.*;
/**
made this work.
- joe
@jmsaavedra
jmsaavedra / _openFrameworks data to arduino over serial.ino
Last active August 29, 2015 14:01
Serial control of Arduino. After kick-off message is sent from OF and a response is received from Arduino, OF continually updates Arduino with 3 bytes of data via a call and response driven by Arduino.
int bytesReceived[3]; //incoming bytes
void setup() {
pinMode(13, OUTPUT); //LED on 13
pinMode(12, OUTPUT); //LED on 12
Serial.begin(9600);
}
void loop()
@jmsaavedra
jmsaavedra / gist:9996360
Last active August 29, 2015 13:58
arduino_write 3 bytes
char inByte; // incoming serial byte
int count1; //for some fake data
int count2; //even more fake data
void setup() {
// start serial port at 115200 bps:
Serial.begin(115200);
// while (!Serial) {
// ; // wait for serial port to connect. Needed for Leonardo only
@jmsaavedra
jmsaavedra / index.php
Last active August 29, 2015 13:58
PHP simpleXML example
<?php
//first grab the xml file
$xml=simplexml_load_file("http://www.stateair.net/web/rss/1/1.xml");
/* simpleXML let's you parse through the entire file */
/* info: http://www.w3schools.com/php/php_xml_simplexml.asp */
//foreach($xml->children() as $child) {
// echo $child->getName() . ": " . $child . "<br>";
//}
//#include <WiFlyHQ.h>
/*
- download visualight library from here:
https://github.com/lpercifield/visualight/releases/download/1.1/Visualight.zip
- unzip, put in the Documents > Arduino > libraries folder
*/
#include <EEPROM.h>