Thursday, May 19, 2016

PI Critter Cam Day 4: Camera Introduction and Keyboard Layout

Today, we make the camera work!

So, we've got it connected and we've got the picamera Python module.

I create a file with the Text Editor and put in the following.

#Needed packages...
import picamera
#create object and initialize camera.
cam = picamera.PiCamera()
#take a pic! 
 cam.capture("test.jpg")
Save it to the desktop as 'test.py.'  You can then double click the file on your desktop to run it.

(Yet another) Interesting tidbit about the PI.  It defaults the keyboard to use the British layout.  This'll cause [SHIFT] + 3 to enter a BRITISH pound, not the number pound (#).

To fix this, you can go to the Menu --> Preferences --> Keyboard and Mouse. Select the Keyboard tab, then press the Keyboard Layout button.

From that window, select the first US layout.  This is what I chose:
















Hopefully, this will be the layout I'm used to.

So, I didn't get a lot worked out after having to figure out the keyboard layout problem.  Tomorrow, more Python.

No comments: