This file contains hidden or 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
| // Sensor Node Transmitter - Mike McRoberts | |
| #define RF69_COMPAT 1 | |
| #include <JeeLib.h> //from jeelabs.org | |
| #define nodeID 10 //node ID of tx (range 0-30) | |
| #define nodeGroup 50 //network group (can be in the range 1-250). | |
| #define nodeFreq RF12_433MHZ //Freq of RF12B can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. Match freq to module | |
| typedef struct { byte battery, year, month, day, hour, minute, second, sensorByte1, sensorByte2; } PacketTX; // create structure - a neat way of packaging data for RF comms |
This file contains hidden or 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 <RFM69.h> | |
| #include <SPI.h> | |
| #include <JeeLib.h> | |
| #include <Wire.h> | |
| #include "HTU21D.h" | |
| ISR(WDT_vect) { Sleepy::watchdogEvent(); } | |
| HTU21D myHumidity; |
This file contains hidden or 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
| //=============================================== | |
| // Wireless sensor node transmission code | |
| // ATMega328 with RFM69CW + Sensor | |
| // M.McRoberts 2014 | |
| //=============================================== | |
| #include <RFM69.h> | |
| #include <SPI.h> | |
| #include <JeeLib.h> | |
| #include <Wire.h> |
This file contains hidden or 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
| local counter = 0 | |
| digits = {} | |
| for w in string.gmatch(s, "%d+") do | |
| digits[counter] = w | |
| print(digits[counter]) | |
| counter = counter+1 | |
| end |
This file contains hidden or 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 <Button.h> | |
| #include <SoftwareSerial.h> | |
| #include <EEPROM.h> | |
| #define LEFT_PIN 5 | |
| #define RIGHT_PIN 4 | |
| #define ENTER_PIN 6 | |
| #define PULLUP false | |
| #define INVERT false | |
| #define DEBOUNCE_MS 20 |
This file contains hidden or 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 <EEPROM.h> | |
| void setup() | |
| { | |
| Serial.begin(115200); | |
| int eepromfirst = EEPROM.read(100); | |
| Serial.println("address 100 = " + String(eepromfirst)); | |
| int eepromRead1 = EEPROM.read(135); |
This file contains hidden or 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
| int height = 3; | |
| int width = 7; | |
| void setup() | |
| { | |
| Serial.begin (115200); | |
| } | |
| void loop() |
This file contains hidden or 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
| Challenge 1. | |
| Generate box with hollow centre, such as: | |
| 4x4 box (This can be any height x width) | |
| #### | |
| # # | |
| # # | |
| #### |
This file contains hidden or 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
| bool isBST() | |
| { | |
| bool isBST = false; | |
| int BSTStart = ((31 - ((((5 * year()) / 4) + 4 ) % 7))); | |
| int BSTEnd = (31 - ((((5 * year()) / 4) + 1) % 7)); | |
| if (month() >= 4 && month() <= 9) | |
| { | |
| isBST = true; | |
| } | |
| else if (month() == 3 && day() >= BSTStart && hour() >= 1) |
This file contains hidden or 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 <ESP8266WiFi.h> | |
| #include <WiFi.h> | |
| #include <WiFiUdp.h> | |
| #include <FastLED.h> | |
| #ifdef __AVR__ | |
| #include <avr/power.h> | |
| #endif | |
| #define DATA_PIN 25 // Data Pin | |
| #define NUM_LEDS 625 // Number of LEDs |
OlderNewer