Skip to content

Instantly share code, notes, and snippets.

View dmiddlecamp's full-sized avatar

David Middlecamp dmiddlecamp

View GitHub Profile
#define STARTING_LATITUDE_LONGITUDE_ALTITUDE NULL
uint8_t internalANT[]={0xB5,0x62,0x06,0x13,0x04,0x00,0x00,0x00,0xF0,0x7D,0x8A,0x2A};
uint8_t externalANT[]={0xB5,0x62,0x06,0x13,0x04,0x00,0x01,0x00,0xF0,0x7D,0x8B,0x2E};
...
setup() {
bool state = false;
void setup() {
pinMode(D7, OUTPUT);
Particle.keepAlive(1.5 * 60);
//Serial1.begin(9600); // crashes, uncomment to run normally.
Particle.function("test", doTest);
void setup() {
Serial.begin(9600);
}
void loop() {
CellularSignal sig = Cellular.RSSI();
String line = String::format("Cellular signal strength: %d (-dBm), link quality: %d (dB)",
sig.rssi, sig.qual
);
#define RED_PIN D0
#define GREEN_PIN D1
#define BLUE_PIN D2
#define COMMON_CATHODE 1
bool rainbow_mode = false;
unsigned int counter = 0;
void setup() {
bool state = false;
int counter = 0;
void setup() {
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
#include "application.h"
#define NUM_SENSORS 1
#define TEMPERATURE_PIN D0
class TempSensor {
public:
char *id ;
SYSTEM_MODE(MANUAL);
unsigned int sleptAt;
bool once = true;
void setup() {
Particle.connect();
delay(8000);
//System.sleep(30);
#define UDP_BROADCAST_PORT 3444
UDP Udp;
IPAddress broadcastAddress(255,255,255,255);
uint8_t txBuffer[256];
char c;
void setup() {
#include "math.h"
const char nyan_cat_intro[] = "DS5,16,E5,16,FS5,8,B5,8,DS5,16,E5,16,FS5,16,B5,16,CS6,16,DS6,16,CS6,16,AS5,16,B5,8,FS5,8,DS5,16,E5,16,FS5,8,B5,8,CS6,16,AS5,16,B5,16,CS6,16,E6,16,DS6,16,E6,16,B5,16\n";
const char nyan_cat_melody[] = "FS5,8,GS5,8,DS5,16,DS5,16,R,16,B4,16,D5,16,CS5,16,B4,16,R,16,B4,8,CS5,8,D5,8,D5,16,CS5,16,B4,16,CS5,16,DS5,16,FS5,16,GS5,16,DS5,16,FS5,16,CS5,16,DS5,16,B4,16,CS5,16,B4,16,DS5,8,FS5,8,GS5,16,DS5,16,FS5,16,CS5,16,DS5,16,B4,16,D5,16,DS5,16,D5,16,CS5,16,B4,16,CS5,16,D5,8,B4,16,CS5,16,DS5,16,FS5,16,CS5,16,DS5,16,CS5,16,B4,16,CS5,8,B4,8,CS5,8,FS5,8,GS5,8,DS5,16,DS5,16,R,16,B4,16,D5,16,CS5,16,B4,16,R,16,B4,8,CS5,8,D5,8,D5,16,CS5,16,B4,16,CS5,16,DS5,16,FS5,16,GS5,16,DS5,16,FS5,16,CS5,16,DS5,16,B4,16,CS5,16,B4,16,DS5,8,FS5,8,GS5,16,DS5,16,FS5,16,CS5,16,DS5,16,B4,16,D5,16,DS5,16,D5,16,CS5,16,B4,16,CS5,16,D5,8,B4,16,CS5,16,DS5,16,FS5,16,CS5,16,DS5,16,CS5,16,B4,16,CS5,8,B4,8,CS5,8,B4,8,FS4,16,GS4,16,B4,8,FS4,16,GS4,16,B4,16,CS5,16,DS5,16,B4,16,E5,16,DS5,16,E5,16,FS5,16,B4,8,
void setup() {
Particle.function("yourFunction", yourFunction);
}
int yourFunction(String cmd) {
digitalWrite(D7, HIGH);
delay(150);
digitalWrite(D7, LOW);
return 0;
}