Skip to content

Instantly share code, notes, and snippets.

View technobly's full-sized avatar

Brett Walach technobly

View GitHub Profile
#define SMTP_SERVER "smtp.yourserver.com"
#define SMTP_USER_BASE64 "base64_encode_your_user"
#define SMTP_PASS_BASE64 "base64_encode_your_pass"
#define SMTP_FROM_EMAIL "[email protected]"
#define SMTP_TO_EMAIL "[email protected]"
#define SMTP_SUBJECT "Email from a Core!"
#define SMTP_BODY "Body body body"
#include "application.h"
@technobly
technobly / sparkWirelessServo.cpp
Created April 8, 2014 13:55
Spark Core Wireless Servo
// WIRELESS SERVO EXAMPLE CODE
// BDub 4/7/2014
//
// Connect RED wire to VIN (~5V)
// Connect ORANGE, YELLOW, or WHITE wire to A0 (servo signal)
// Connect BLACK or BROWN wire to GND (0V)
// Adjust these connections for your particular servo
// if you have a wiring diagram for it.
//
//
@technobly
technobly / README.md
Last active August 29, 2015 14:03
NeoPixel Library Timing Tweak for TM1829 Pixels (use WS2812B define)

Keybase proof

I hereby claim:

  • I am technobly on github.
  • I am bdub (https://keybase.io/bdub) on keybase.
  • I have a public key whose fingerprint is 4C0E 1402 48CC C55E 1312 707D B62C 54A3 C279 6C78

To claim this, I am signing this object:

@technobly
technobly / servo_test.cpp
Created December 28, 2014 15:59
Spark Core Manual Servo Tester
#include "application.h"
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(A0); // attaches the servo on the A0 pin to the servo object
@technobly
technobly / particle-ping.cpp
Created October 21, 2015 02:30
Particle Photon/Core/P1/Electron Ping PulseIn Example (HC-SR04)
/*
******************************************************************************
* Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@technobly
technobly / particle-ping-sound.cpp
Created October 21, 2015 04:14
Particle Photon/Core/P1/Electron Ping PulseIn Example (HC-SR04) with Sound!
/*
******************************************************************************
* Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@technobly
technobly / police-button.cpp
Last active December 15, 2015 14:17
Particle Internet Button Police Lights
// 1. CREATE A NEW APP at https://build.particle.io
// 2. PASTE THIS CODE IN and SAVE
// 3. GO TO LIBRARIES, OPEN the NEOPIXEL library
// 4. Click INLUCDE IN APP
// 5. SELECT THE APP YOU PASTED/SAVED THIS CODE IN
// 6. Click ADD TO THIS APP
// 7. COMPILE and FLASH to a PARTICLE INTERNET BUTTON
// 8. SHINE IT DOWN ON SOMETHING AND BE AMAZED :)
// 9. WOOP WOOP!!, THAT'S THE SOUND OF THE POLICE!
//
#include "application.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
// ALL_LEVEL, TRACE_LEVEL, DEBUG_LEVEL, INFO_LEVEL, WARN_LEVEL, ERROR_LEVEL, PANIC_LEVEL, NO_LOG_LEVEL
Serial1DebugOutput debugOutput(9600, ALL_LEVEL);
unsigned long whenPublished = 0;
retained int publishCount = 0;
@technobly
technobly / band-select.cpp
Last active September 8, 2016 07:32
Band Selection on the Particle Electron
// COMPILE from firmware/modules $
// make clean all PLATFORM_ID=10 APPDIR=~/code/fw-apps/band-select COMPILE_LTO=n DEBUG_BUILD=y -s program-dfu
//
// NOTE: APPDIR=~/code/fw-apps/band-select can be APP=band-select if that's easier
/* Includes ------------------------------------------------------------------*/
#include "application.h"
#include "cellular_hal.h"
typedef struct {