Hardware Reference
In-Depth Information
4. Note that the build process will take some time. You might want to step
away from the Pi for twenty minutes to stretch your legs. Once it's finished,
you may exit the source directory and delete it:
pi@raspberrypi ~/libcec $ cd .. && rm -rf libcec
5.
We will be using a utility called cec-client to send CEC messages to the
TV. Issue the following command to switch off your TV:
pi@raspberrypi ~ $ echo "standby 0" | cec-client -d 1 -s
6.
Use the following command to turn your TV on again:
pi@raspberrypi ~ $ echo "on 0" | cec-client -d 1 -s
Scheduling video recording or staging a
playback scare
At this stage, you already know all the individual techniques used for this example.
It's simply a matter of combining what you've learned so far to achieve the effect
you want.
We'll try to illustrate a bit of everything with one sweet prank: you will prepare your
Pi at home, take it over to your friend's house, and sneakily hook it up to the living
room TV. In the middle of the night, the TV will turn itself on and a creepy video
of your choice will start to play. This freaky incident might repeat itself a couple of
times during the night, or we could take the prank to phase two: whenever someone
walks into the room, their presence is detected and the video is played.
Let's start prepping the Pi! We will assume that no network connection is available
at your friend's house, so we'll have to create a new ~/autorun.sh script to perform
our prank, together with an at timer in /etc/rc.local that starts counting down
when the Pi is plugged in at your friend's house.
Here's the new ~/autorun.sh script:
#!/bin/sh
#
# Raspberry Pi Video Prank Script
# Use chmod +x ~/autorun.sh to enable.
CREEPY_MOVIE="AJn5Y65GAkA.mp4" # Creepy movie to play, located in the
Pi home directory
MOVIE_LOOPS="1" # Number of times to play creepy movie (1 by default)
MOVIE_SLEEP="3600" # Number of seconds to sleep between movie plays (1
hour by default)
 
Search WWH ::




Custom Search