Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / ardudroid.ino
Created September 7, 2014 02:19
ArduDroid
/*
PROJECT: ArduDroid
PROGRAMMER: Hazim Bitar (techbitar at gmail dot com)
DATE: Oct 31, 2013
FILE: ardudroid.ino
LICENSE: Public domain
*/
#define START_CMD_CHAR '*'
#define END_CMD_CHAR '#'
#!/usr/bin/python
import sys
import time
import datetime
import requests
import Adafruit_DHT
from time import gmtime, strftime
sensor = Adafruit_DHT.DHT22
pin = 4
@anoochit
anoochit / hello.service
Created September 23, 2014 05:06
node.js systemd unit file
[Unit]
Description=Hello Express Service
After=mongod.service
[Service]
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=node-hello
Environment=NODE_ENV=production
@anoochit
anoochit / example.py
Created September 28, 2014 15:29
example file for ds18b20 python module
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
from ds18b20 import DS18B20
def main():
sensor = DS18B20()
while True:
@anoochit
anoochit / blink.py
Created October 4, 2014 17:04
raspberry pi gpio blink example
@anoochit
anoochit / button.py
Last active August 29, 2015 14:07
raspberry pi button and led with gpio
#!/usr/bin/env python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(27,GPIO.OUT)
GPIO.output(27,GPIO.LOW)
@anoochit
anoochit / index.html
Last active August 29, 2015 14:07
polymer tutorial step 01
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title Page</title>
<script src="components/bower_components/platform/platform.js"></script>
<link rel="import" href="components/bower_components/paper-elements/paper-elements.html">
<link rel="import" href="components/bower_components/core-toolbar/core-toolbar.html">
@anoochit
anoochit / index.html
Last active August 29, 2015 14:07
polymer tutorial step 02
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title Page</title>
<script src="components/bower_components/platform/platform.js"></script>
<link rel="import" href="components/bower_components/paper-elements/paper-elements.html">
<link rel="import" href="components/bower_components/core-toolbar/core-toolbar.html">
@anoochit
anoochit / ardudroid-mortor
Created October 19, 2014 03:38
ardudroid and motor controller
#define START_CMD_CHAR '*'
#define END_CMD_CHAR '#'
#define DIV_CMD_CHAR '|'
#define CMD_DIGITALWRITE 10
#define CMD_ANALOGWRITE 11
#define CMD_TEXT 12
#define CMD_READ_ARDUDROID 13
#define MAX_COMMAND 20 // max command number code. used for error checking.
#define MIN_COMMAND 10 // minimum command number code. used for error checking.
#define IN_STRING_LENGHT 40
@anoochit
anoochit / Main.java
Created October 19, 2014 03:52
joystick controller + bluetooth spp library for arduino robot
public void setup() {
textView1 = (TextView) findViewById(R.id.textView1);
textView2 = (TextView) findViewById(R.id.textView2);
textView3 = (TextView) findViewById(R.id.textView3);
textView4 = (TextView) findViewById(R.id.textView4);
textView5 = (TextView) findViewById(R.id.textView5);
layout_joystick = (RelativeLayout) findViewById(R.id.layout_joystick);