Skip to content

Instantly share code, notes, and snippets.

@kenci
kenci / i2c-arduino.ino
Created November 22, 2015 18:51
Sending float array through I2C from Arduino to RPi
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
#define FLOATS_SENT 3
float data[FLOATS_SENT];
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600); // start serial for output
@kenci
kenci / ambilight.ino
Created November 22, 2015 18:44
Ambilight for Arduino
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 248
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 5
//#define CLOCK_PIN 13
@kenci
kenci / rx433_rpi.ino
Last active November 22, 2015 18:42
TinyRX433_RPI
// RFM12B Receiver for RaspberryPI
//
// Basiert zum Teil auf der Arbeit von Nathan Chantrell
//
// modified by meigrafd @ 16.12.2013 - for UART on RaspberryPI
//------------------------------------------------------------------------------
#include <RFM12B.h>
#include <avr/sleep.h>
#include <SoftwareSerial.h>
//------------------------------------------------------------------------------
@kenci
kenci / tx433_watchdog_10min.ino
Last active November 20, 2015 23:49
TinyTX433_WATCHDOG_10MIN
// RFM12B Sender for DHT22 Sensor with Watchdog (saves much more Power!)
//
// Basiert zum Teil auf der Arbeit von Nathan Chantrell
//
// modified by meigrafd @ 12.01.2015
//------------------------------------------------------------------------------
#include <RFM12B.h>
#include <avr/sleep.h>
#include <DHT22.h> // https://github.com/nathanchantrell/Arduino-DHT22
@kenci
kenci / installation.txt
Created October 30, 2015 12:37
Hifiberry OSMC
Programs -> OSMC Settings -> PI Config -> Hardware Support -> Soundcard overlay = "hifiberry-digi-overlay"
Remove LIRC from config
Reboot
Settings -> System -> Audio Output -> Audio Output Device -> "Alsa: Default(snd_hifiberry_digi...)
@kenci
kenci / install-duplicity.txt
Last active October 25, 2015 10:20
Duplicity installation
sudo apt-get install ncftp
sudo apt-get install duplicity
sudo apt-get install python-paramiko python-gobject-2
@kenci
kenci / lib.m path
Created October 22, 2015 06:36
Arduino ieee754_sqrt
C:\Users\kenci\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9\xtensa-lx106-elf\lib
@kenci
kenci / disk-idle.sh
Last active October 20, 2015 03:47
Disk status check
#!/bin/bash
result=$(sudo /sbin/hdparm -C /dev/sda1)
if [[ $result == *"active"* ]]
then
echo true;
else
echo false;
fi
@kenci
kenci / gist:d7bdb93a69642caa5e9d
Created October 19, 2015 00:41
ESP8266 Generic
Flash frequency = 80 Mhz
Cpu frequency = 160 Mhz
Flash Size = 1M (256K SPIFFS)
DIO
Speed = 921.000
@kenci
kenci / pool-info.c
Created October 18, 2015 12:58
TM1608 Display
/**
* gcc -std=c99 clk.c -o clk -lbcm2835 -ltm1638
*
* @file
* @brief Hello World for TM1638 based displays
* @author Martin Oldfield <[email protected]>
* @version 0.1
*
* @section DESCRIPTION
*