Skip to content

Instantly share code, notes, and snippets.

View AdamLoi's full-sized avatar

Adam Loizos AdamLoi

View GitHub Profile
@AdamLoi
AdamLoi / DS18B20
Created June 26, 2014 13:01
DS18B20
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
//GRobotronics 28-5-2014
// Arduino pins connected to the 4511
const uint8_t LedA = 5;
const uint8_t LedB = 8;
const uint8_t LedC = 7;
const uint8_t LedD = 6;
// Arduino pins connected to the segment driver transistors
const uint8_t Led1 = 1;
@AdamLoi
AdamLoi / gist:10530101
Created April 12, 2014 11:01
Make your plants smile
//GRobotronics 29/3/2014
unsigned char i;
unsigned char j;
/*Port Definitions*/
int Max7219_pinCLK = 2;
int Max7219_pinCS = 1;
int Max7219_pinDIN = 0;
#include <Wire.h>
#include <i2ckeypad.h>
#define ROWS 4
#define COLS 3
// With A0, A1 and A2 of PCF8574 to ground I2C address is 0x38
#define PCF8574_ADDR 0x38
@AdamLoi
AdamLoi / gist:9275746
Created February 28, 2014 17:41
LCD Display and ATtiny85
#include <TinyWireM.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20,16,2); // set address & 16 chars / 2 lines
void setup()
{
TinyWireM.begin(); // initialize I2C lib
lcd.init(); // initialize the lcd
@AdamLoi
AdamLoi / gist:9227579
Created February 26, 2014 11:01
IRremote Arduino Example
/* YourDuino.com Example Software Sketch
IR Remote Kit Test
Uses YourDuino.com IR Infrared Remote Control Kit 2
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
based on code by Ken Shirriff - http://arcfn.com
Get Library at: https://github.com/shirriff/Arduino-IRremote
Unzip folder into Libraries. RENAME folder IRremote
[email protected] */
/*-----( Import needed libraries )-----*/
/*================================================================
This demo code shows how to use the touch screen in TFT01
The LCD connection is the same as that in “8 Bit Pant Demo“
by Elecfreaks
================================================================*/
#define LCD_RS 19
#define LCD_WR 18
#define LCD_CS 17