My 11yr old son has written his first apple app, and it is called 'Clic it!'.
If you have any problems using the app, or find bugs, please let us know. Updates to follow.His app is available here
This blog profiles some of the computing work my son is working on.
Raspberry Pi door bell, with X-Mini as amp |
### BEGIN INIT INFO
# Provides: doorboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start door bell python script at boot time
# Description: Start doorbell at boot time.
### END INIT INFO
#! /bin/sh
# /etc/init.d/doorboot
case "$1" in
start)
echo "Starting DoorBell"
python /home/pi/doorbell.py &
;;
stop)
echo "Stopping DoorBell"
python -kill :0
;;
*)
echo "Usage: /etc/init.d/doorboot {start|stop}"
exit 1
;;
esac
exit 0
#!/usr/bin/python
from subprocess import call
print('ding dong')call(["mplayer","Ding Dong.mp3"])
#!/usr/bin/python
## Changed call to Popen to get the mp3 player to run as a subprocess
## Opened a google account just for my doorbell
## Set up a the doorbell as a VIP on my Iphone with doorbell sound
import wiringpi
from time import sleep
import smtplib
import string
from subprocess import Popen
msg="There is somebody at the door"
##ensure that pin 17 is set as input
## and pull up is set
call(['gpio','export','17','in'])call(['gpio','-g','mode','17','up'])
# to use Raspberry Pi board pin numbers
io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_SYS)
io.pinMode(17,io.INPUT)
#This function sends an email message to toaddrs
def sendmsg(msg):
gmail_user = "**********"
gmail_pwd = "**********" fromaddrs = "frontdoor"
toaddrs ="iPhone1, iPhone2, Ipod3"
subject = "Doorbell" body=[]
body='\n'.join([
"From: %s" % fromaddrs,
"To: %s" % toaddrs,
"Subject: %s" % subject,
" ",
msg
,'\r\n'])
server = smtplib.SMTP("smtp.gmail.com:587")
server.starttls()
server.login(gmail_user,gmail_pwd)
server.sendmail(fromaddrs, toaddrs.split(","), body)
server.quit()
return
#Run a continuous loop checking for bell push
while True:
# get input from GPIO
input_value = io.digitalRead(17)
#Let RasPi rest for a bit
sleep(0.1)
if input_value==False:
# if pin is grounded sound bell and send email p=Popen(["mpg123","-q","Ding Dong.mp3"]) sendmsg(msg)