Skip to content

Instantly share code, notes, and snippets.

@wgbartley
wgbartley / Spark-SensorMadness.pde
Last active January 2, 2016 12:09
Combines all my environmental sensors into a single sketch. Data is retrieved by passing a string to fnrouter() exposed to the cloude API.
#include <math.h>
#define MAXTIMINGS 85
#define cli noInterrupts
#define sei interrupts
#define DHT11 11
#define DHT22 22
#define DHT21 21
@wgbartley
wgbartley / My_analogRead.cpp
Last active January 1, 2016 18:29
Custom analogRead function for testing different ADC_SAMPLING_TIME values
#define MY_ADC_SAMPLING_TIME ADC_SampleTime_239Cycles5
uint8_t My_adcInitFirstTime = true;
uint8_t My_adcChannelConfigured = NONE;
PinMode My_digitalPinModeSaved = (PinMode)NONE;
void My_ADCInit()
{
ADC_InitTypeDef ADC_InitStructure;