Skip to content

Instantly share code, notes, and snippets.

View Miceuz's full-sized avatar

Albertas Mickėnas Miceuz

View GitHub Profile
@Miceuz
Miceuz / Chirp-sensor-set-address.ino
Last active September 3, 2016 07:42
Set Chirp sensor an address
#include <Wire.h>
void writeI2CRegister8bit(int addr, int reg, int value) {
Wire.beginTransmission(addr);
Wire.write(reg);
Wire.write(value);
Wire.endTransmission();
}
void writeI2CRegister8bit(int addr, int value) {
@Miceuz
Miceuz / DS18x20 logger
Created October 9, 2014 15:39
Logger DS18x20 based temperature logger.
#include <SD.h>
#include <OneWire.h>
#include <Wire.h>
#include <DallasTemperature.h>
#include <stdlib.h>
#include "RTClib.h"
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9
#define NUMBER_OF_SENSORS 20
#include <SD.h>
#include <OneWire.h>
#include <Wire.h>
#include <DallasTemperature.h>
#include <stdlib.h>
#include "RTClib.h"
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9
#define NUMBER_OF_SENSORS 20
// ==============================================================================
// uDMX.c
// firmware for usb to dmx interface
//
// License:
// The project is built with AVR USB driver by Objective Development, which is
// published under an own licence based on the GNU General Public License (GPL).
// usb2dmx is also distributed under this enhanced licence. See Documentation.
//
// target-cpu: ATMega8 @ 12MHz
@Miceuz
Miceuz / stepper-encoder-7seg.ino
Last active December 13, 2015 21:28
Some arduino / avr code to read a rotary encoder and drive a single 7 segment display.
void setup() {
DDRD = 0xFF;
PORTD = 1;
pinMode(8, INPUT);
pinMode(9, INPUT);
}
byte digits[] = {
0b00000011,//0
0b11110011,//1