Wednesday, May 14, 2014

Raspberry Pi Picture Frame Post 9 Remote Setup

Remote Setup

Now I have already talked about setting the remote setup but we haven't gotten it completely setup. So we talked about how to get the pi to setup the individual pins as input or output. From my scripts folder the setup file is Currently I have 4 inputs and 1 output. I am probably going to add another input so that the pi can tell if the monitor is on or off. This way you can program the pi to turn the picture frame on every morning at 8 and off at 4 or whatever you like. While we can currently do that the pi doesn't know the state of the monitor so all we can tell it to do is toggle the display so if you use the remote to turn it off then at the scheduled time it would actually turn the monitor back on. Now my script is something that needs to be continually running. What I decided is but A will start the slideshow. Button B will show weather. Button C will show weather1 and button D will turn the display off/on. Basically we are constantly checking to see if a pin is high and if it is we run a script based on which button is pressed.

Now we need to run this script at startup as well. I am not sure why but Ted Hale doesnt put this in the same place as the slideshow start location. He puts at the end of /etc/rc.local. To edit that file we use {{sudo nano /etc/rc.local}} The line we want to add is {{/home/pi/drive/scripts/ &}} and we want to add the before the exit 0 line. For those of you who are paying attention you may be wondering why do we have the & sign. What that sign does is tell the pi to run that script in the background. Otherwise we would never get anywhere because the pi would wait for that script to end and it never would.

Now at this point I believe that the picture frame is all ready to go. Testing is going to take a while which is always the fun part. Now I still have the frame to build but that can and will wait until I get some testing done. Some how my frame is going to have to let air flow because the screen generates a good bit of heat. I also want to make a good cheat cheat sheet of what does what and what goes where. Luckily most of that information is in these blog posts already. Just need to  bring them all into a simple file.

No comments:

Post a Comment