Skip to content

Instantly share code, notes, and snippets.

David Middlecamp dmiddlecamp

Block or report user

Report or block dmiddlecamp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gps_antenna_switch.ino
#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() {
View serial_crash.ino
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);
View electron_signal.ino
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
);
View holiday_tree.ino
#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() {
View basic_blinky.ino
bool state = false;
int counter = 0;
void setup() {
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
View multi-ds18b20.ino
#include "application.h"
#define NUM_SENSORS 1
#define TEMPERATURE_PIN D0
class TempSensor {
public:
char *id ;
View manual_sleep.ino
SYSTEM_MODE(MANUAL);
unsigned int sleptAt;
bool once = true;
void setup() {
Particle.connect();
delay(8000);
//System.sleep(30);
View gist:24db9746998373872b472b616135dcc4
#define UDP_BROADCAST_PORT 3444
UDP Udp;
IPAddress broadcastAddress(255,255,255,255);
uint8_t txBuffer[256];
char c;
void setup() {
View nyan_cat.ino
#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,
View function_demo.ino
void setup() {
Particle.function("yourFunction", yourFunction);
}
int yourFunction(String cmd) {
digitalWrite(D7, HIGH);
delay(150);
digitalWrite(D7, LOW);
return 0;
}
You can’t perform that action at this time.