This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: TEMT6000 | |
* | |
* Take readings on TEMT6000 and send across wire on request via I2C in 3 segment 16byte packets | |
* ID of PROPERTY (set in _properties) | |
* VALUE of PROPERTY (set in getProperties) | |
* MORE TO COME (0/1 0 = last property) | |
* | |
* Pins on ATTINY85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#define ADDRESS_SLAVE 10 | |
bool _outputPlotterOnly = false; | |
bool _confirmedMetadata = false; | |
int _packetSegment = 0; | |
bool _i2cNodeProcessed = false; | |
char _property[2][24] = {"name", "value"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: MAX9812 | |
* | |
* Take readings on MAX9812 and send across wire on request via I2C in 3 segment 16byte packets | |
* ID of PROPERTY (set in _properties) | |
* VALUE of PROPERTY (set in getProperties) | |
* MORE TO COME (0/1 0 = last property) | |
* | |
* Pins on ATTINY85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************** | |
Example Sound Level Sketch for the | |
Adafruit Microphone Amplifier | |
****************************************/ | |
#define USE_SOFTWARE_SERIAL 1 | |
#if (USE_SOFTWARE_SERIAL) | |
#include <SoftwareSerial.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************** | |
Example Sound Level Sketch for the | |
Adafruit Microphone Amplifier | |
****************************************/ | |
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) | |
unsigned int sample; | |
void setup() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: TEMT6000 | |
* | |
* Take readings on GY302 and send across wire on request via I2C in 3 segment 16byte packets | |
* ID of PROPERTY (set in _properties) | |
* VALUE of PROPERTY (set in getProperties) | |
* MORE TO COME (0/1 0 = last property) | |
* | |
* Pins on ATTINY85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.avrfreaks.net/forum/attiny85-vcc-measurement-skews-higher-vcc-voltages | |
//5v = 6393, 6504 | |
//3.3V 3430 | |
bool is3V3() { | |
// Read 1.1V reference against AVcc | |
// set the reference to Vcc and the measurement to the internal 1.1V reference | |
ADMUX = _BV(MUX3) | _BV(MUX2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: MQ2 | |
* | |
* Take readings on MQ2 and send across wire on request via I2C in 3 segment 16byte packets | |
* ID of PROPERTY (set in _properties) | |
* VALUE of PROPERTY (set in getProperties) | |
* MORE TO COME (0/1 0 = last property) | |
* | |
* Pins on ATTINY85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: DHT11 | |
* | |
* Take readings on DHT11 and send across wire on request via I2C in 3 segment 16byte packets | |
* ID of PROPERTY (set in _properties) | |
* VALUE of PROPERTY (set in getProperties) | |
* MORE TO COME (0/1 0 = last property) | |
* | |
* Pins on ATTINY85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#define ADDRESS_SLAVE 8 | |
int _packetSegment = 0; | |
bool _i2cNodeProcessed = false; | |
char _property[2][16] = {"name", "value"}; | |
void setup() { | |
Wire.begin(); // join i2c bus (address optional for master) |