Skip to content

Instantly share code, notes, and snippets.

View sorz's full-sized avatar
😱
AAHHH

Shell Chen sorz

😱
AAHHH
View GitHub Profile
@sorz
sorz / DHT11.ino
Created May 11, 2013 18:33
DHT11 on Arduino. Send temperature and humidity by serial.
#define DHT11_PIN 2
void setup() {
pinMode(DHT11_PIN, INPUT_PULLUP);
Serial.begin(115200, SERIAL_8E1);
}
void loop() {
if (Serial.available() > 0) {
byte in = Serial.read();
@sorz
sorz / MMA7455L.py
Last active December 17, 2015 05:49
Read acceleration from MMA7455L via I2C by Python.
#!/usr/bin/env python
import smbus
import time
class Accel():
def __init__(self, dev=1, g=2):
self.bus = smbus.SMBus(dev)
self.set_range(g)