android SyncManager

SyncManager

static {
final boolean isLargeRAM = !ActivityManager.isLowRamDeviceStatic();
int defaultMaxInitSyncs = isLargeRAM ? 5 : 2;
int defaultMaxRegularSyncs = isLargeRAM ? 2 : 1;
MAX_SIMULTANEOUS_INITIALIZATION_SYNCS =
SystemProperties.getInt(“sync.max_init_syncs”, defaultMaxInitSyncs);
MAX_SIMULTANEOUS_REGULAR_SYNCS =
SystemProperties.getInt(“sync.max_regular_syncs”, defaultMaxRegularSyncs);
LOCAL_SYNC_DELAY =
SystemProperties.getLong(“sync.local_sync_delay”, 30 * 1000 /* 30 seconds */);
MAX_TIME_PER_SYNC =
SystemProperties.getLong(“sync.max_time_per_sync”, 5 * 60 * 1000 /* 5 minutes */);
SYNC_NOTIFICATION_DELAY =
SystemProperties.getLong(“sync.notification_delay”, 30 * 1000 /* 30 seconds */);
}

Arduino Tones and RTTTL

http://karenian.wordpress.com/2013/03/13/arduino-buzzer-synthesizer/

http://www.linuxcircle.com/2013/03/31/playing-mario-bros-tune-with-arduino-and-piezo-buzzer/

http://www.rt-thread.org/phpBB3/viewtopic.php?t=2178

http://forum.arduino.cc/index.php/topic,8409.0.html !!!

http://arcadetones.emuunlim.com/nes.htm

树莓派控制步进电机

http://computers.tutsplus.com/tutorials/controlling-dc-motors-using-python-with-a-raspberry-pi–cms-20051

import RPi.GPIO as GPIO
from time import sleep

GPIO.setmode(GPIO.BOARD)

Motor1A = 11
Motor1B = 13
Motor1C = 15
Motor1D = 16

GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1C,GPIO.OUT)
GPIO.setup(Motor1D,GPIO.OUT)

print "Turning motor on"
step = 0
STEP_COUNT = 8
HARD_DELAY = 0.0015
FAST_DELAY = 0.0008
DELAY = HARD_DELAY
def nextStep(num):
        global step
        for i in range(num):
                handleStep()
                step += 1
                step %= STEP_COUNT
def previousStep(num):
        global step
        for i in range(num):
                handleStep()
                step -= 1
                if step < 0: step += STEP_COUNT
def handleStep():
        global step, DELAY
        if step == 0:
                GPIO.output(Motor1D, GPIO.LOW)
                GPIO.output(Motor1C, GPIO.HIGH)
                GPIO.output(Motor1B, GPIO.HIGH)
                GPIO.output(Motor1A, GPIO.HIGH)
        if step == 1:
                GPIO.output(Motor1D, GPIO.LOW)
                GPIO.output(Motor1C, GPIO.LOW)
                GPIO.output(Motor1B, GPIO.HIGH)
                GPIO.output(Motor1A, GPIO.HIGH)
        if step == 2:
                GPIO.output(Motor1D, GPIO.HIGH)
                GPIO.output(Motor1C, GPIO.LOW)
                GPIO.output(Motor1B, GPIO.HIGH)
                GPIO.output(Motor1A, GPIO.HIGH)
        if step == 3:
                GPIO.output(Motor1D, GPIO.HIGH)
                GPIO.output(Motor1C, GPIO.LOW)
                GPIO.output(Motor1B, GPIO.LOW)
                GPIO.output(Motor1A, GPIO.HIGH)
        if step == 4:
                GPIO.output(Motor1D, GPIO.HIGH)
                GPIO.output(Motor1C, GPIO.HIGH)
                GPIO.output(Motor1B, GPIO.LOW)
                GPIO.output(Motor1A, GPIO.HIGH)
        if step == 5:
                GPIO.output(Motor1D, GPIO.HIGH)
                GPIO.output(Motor1C, GPIO.HIGH)
                GPIO.output(Motor1B, GPIO.LOW)
                GPIO.output(Motor1A, GPIO.LOW)
        if step == 6:
                GPIO.output(Motor1D, GPIO.HIGH)
                GPIO.output(Motor1C, GPIO.HIGH)
                GPIO.output(Motor1B, GPIO.HIGH)
                GPIO.output(Motor1A, GPIO.LOW)
        if step == 7:
                GPIO.output(Motor1D, GPIO.LOW)
                GPIO.output(Motor1C, GPIO.HIGH)
                GPIO.output(Motor1B, GPIO.HIGH)
                GPIO.output(Motor1A, GPIO.LOW)
        sleep(DELAY)
def toggle():
        global DELAY, HARD_DELAY, FAST_DELAY
        print "forward.."
        nextStep(9500)
        print "backward.."
        DELAY = FAST_DELAY
        previousStep(7500)
        print "done!"
def clean():
        GPIO.output(Motor1A, GPIO.HIGH)
        GPIO.output(Motor1B, GPIO.HIGH)
        GPIO.output(Motor1C, GPIO.HIGH)
        GPIO.output(Motor1D, GPIO.HIGH)
try:
        toggle()
except Exception, ex:
        print "exception: ", ex
finally:
        print "finally clean."
        clean()
        GPIO.cleanup()

webiopy安装配置方法

https://code.google.com/p/webiopi/

https://code.google.com/p/webiopi/wiki/PASSWORD

https://code.google.com/p/webiopi/wiki/INSTALL?tm=6