Skip to content

Instantly share code, notes, and snippets.

#include <NeoPixelBus.h>
#include <NeoPixelAnimator.h>
#define PIN_LEDS 21
#define NUMPIXELS 194
#define LIGHTNESS 0.05f
#define BRIGHTNESS 64
RgbColor BLACK(0, 0, 0);
/*
This is an example of how simple driving a Neopixel can be
This code is optimized for understandability and changability rather than raw speed
More info at http://wp.josh.com/2014/05/11/ws2812-neopixels-made-easy/
*/
// Change this to be at least as long as your pixel string (too long will work fine, just be a little slower)
#define PIXELS 46 // Number of pixels in the string
@jpraus
jpraus / scarylight.ino
Created November 16, 2018 19:20
arduino-scarylight
#define TRIAC_PIN 2
void setup() {
Serial.begin(115200);
digitalWrite(TRIAC_PIN, LOW);
pinMode(TRIAC_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
@jpraus
jpraus / ot-communication.c
Created March 27, 2018 20:16
Record of OT communication data
1. -> ReadData 26 0 0 <- ReadAck 26 29 99 (DHW temp 41.59°C)
2. -> WriteData 56 0 0 <- WriteAck 56 23 0 (DHW setpoint 35°C)
3. -> ReadData 0 0 0 <- ReadAck 0 0 0 (Status)
4. -> WriteData 1 0 0 <- WriteAck 1 0 0 (Control setpoint 0°C)
5. -> ReadData 27 0 0 <- ReadAck 27 A 0 (Outside temp 10°C)
6. -> ReadData 25 0 0 <- ReadAck 25 1C 99 (Boiler water temp 28.59°C)
7. -> ReadData 28 0 0 <- ReadAck 28 1A 19 (Return water temp 26.12°C)
8. -> ReadData 17 0 0 <- ReadAck 17 0 0 (Relative Modulation Level 0%)
9. -> ReadData 19 0 0 <- ReadAck 19 0 0 (DHW flow rate 0 l/min)
10. -> ReadData 33 0 0 <- ReadAck 33 0 22 (Exhaust temp 34°C)
@jpraus
jpraus / ot-gateway.ino
Created March 27, 2018 20:13
Opentherm gateway library example
#include <opentherm.h>
#define THERMOSTAT_IN 2
#define THERMOSTAT_OUT 4
#define BOILER_IN 3
#define BOILER_OUT 5
OpenthermData message;
void setup() {
@jpraus
jpraus / example.ino
Created March 27, 2018 20:09
Opentherm gateway first example
void setup() {
Serial.begin(19200);
pinMode(2, INPUT);
}
void loop() {
byte data = digitalRead(2);
if (data == HIGH) {
delayMicroseconds(250); // wait until you are in the 1/4 of the start bit
for (int i = 0; i < 34; i++) { // read whole data packet