@@ -0,0 +1,1068 @@
+'''%0A%0ADr Who Box: Blue Effects LED%0A%0A'''%0A%0Afrom __future__ import print_function%0Aimport RPi.GPIO as GPIO%0Aimport time%0Afrom multiprocessing import Process%0Aimport math%0A%0A# Define PINS%0ALED = 18%0A%0A# Use numbering based on P1 header%0AGPIO.setmode(GPIO.BOARD)%0AGPIO.setwarnings(False)%0AGPIO.setup(LED, GPIO.OUT, GPIO.LOW)%0A%0A%0Adef pulsateLed():%0A    pwm = GPIO.PWM(LED, 100)%0A    pwm.start(0)%0A    values = %5Bmath.sin(x*math.pi/180.0) for x in range (0,181)%5D%0A    values = %5Bint(100*x**3) for x in values%5D%0A    increasing = True%0A    count = 0%0A    delay = 0.02%0A    pwm.start(0)%0A %0A    while True:%0A        pwm.ChangeDutyCycle(values%5Bcount%5D)%0A     %0A        time.sleep(delay)%0A%0A        if increasing:%0A            count += 1%0A        else:%0A            count -= 1%0A %0A        if (count %3E= len(values)-1):%0A            increasing = False%0A %0A        if (count %3C= 0):%0A            increasing = True%0A %0A# Wait forever...%0Atry:%0A    p = Process(target=pulsateLed)%0A    p.start()%0A    while True:%0A        time.sleep(1)%0A        print(time.asctime(),'and python is running!')%0Aexcept:%0A    GPIO.cleanup()%0A    p.terminate()%0A

Add stand-alone demo of pulsating LED using multiprocess.