diff --git a/images/rik-picture.png b/images/rik-picture.png new file mode 100644 index 0000000..7f273e0 Binary files /dev/null and b/images/rik-picture.png differ diff --git a/images/test-buttons.png b/images/test-buttons.png new file mode 100644 index 0000000..84d2323 Binary files /dev/null and b/images/test-buttons.png differ diff --git a/overlays/blank.png b/overlays/blank.png new file mode 100644 index 0000000..10080ea Binary files /dev/null and b/overlays/blank.png differ diff --git a/overlays/cowboy.png b/overlays/cowboy.png new file mode 100644 index 0000000..b41d6c5 Binary files /dev/null and b/overlays/cowboy.png differ diff --git a/overlays/elvis.png b/overlays/elvis.png new file mode 100644 index 0000000..adbf458 Binary files /dev/null and b/overlays/elvis.png differ diff --git a/overlays/emo.png b/overlays/emo.png new file mode 100644 index 0000000..f1d7965 Binary files /dev/null and b/overlays/emo.png differ diff --git a/overlays/flowers.png b/overlays/flowers.png new file mode 100644 index 0000000..6f1d124 Binary files /dev/null and b/overlays/flowers.png differ diff --git a/overlays/girl.png b/overlays/girl.png new file mode 100644 index 0000000..6411c2a Binary files /dev/null and b/overlays/girl.png differ diff --git a/overlays/glasses.png b/overlays/glasses.png new file mode 100644 index 0000000..8f22290 Binary files /dev/null and b/overlays/glasses.png differ diff --git a/overlays/glassesnose.png b/overlays/glassesnose.png new file mode 100644 index 0000000..66f480a Binary files /dev/null and b/overlays/glassesnose.png differ diff --git a/overlays/mop.png b/overlays/mop.png new file mode 100644 index 0000000..da8bd96 Binary files /dev/null and b/overlays/mop.png differ diff --git a/overlays/moustache.png b/overlays/moustache.png new file mode 100644 index 0000000..ca2b977 Binary files /dev/null and b/overlays/moustache.png differ diff --git a/overlays/pink.png b/overlays/pink.png new file mode 100644 index 0000000..d7256f6 Binary files /dev/null and b/overlays/pink.png differ diff --git a/overlays/sunglasses.png b/overlays/sunglasses.png new file mode 100644 index 0000000..6d570de Binary files /dev/null and b/overlays/sunglasses.png differ diff --git a/overlays/top.png b/overlays/top.png new file mode 100644 index 0000000..f5d6e0d Binary files /dev/null and b/overlays/top.png differ diff --git a/worksheet2.md b/worksheet2.md index e0ca966..bc62ca1 100644 --- a/worksheet2.md +++ b/worksheet2.md @@ -22,14 +22,13 @@ In this resource you will make a tweeting touch screen photo booth using a Raspb 1. Click on `File` > `Save` and save your file into the `allseeingpi` folder you just created, with the filename `allseeingpi.py`. -1. We will need the `picamera` and the `gpiozero` libraries. At the start of your Python file add two import statements: +1. We will need the `gpiozero` library. At the start of your Python file add an import statement: ```python -from picamera import PiCamera from gpiozero import Button ``` -1. Next we will set up the buttons. On the [previous worksheet](worksheet.md) we wired our buttons to pins 23 and 25. Let's go ahead and set both buttons up, even though we will not use the `next_overlay_btn` until later on. +1. Next we will set up the buttons. On the [previous worksheet](worksheet.md) we wired our buttons to pins 23 and 25. Let's go ahead and set both buttons up. ```python next_overlay_btn = Button(23) @@ -43,7 +42,7 @@ from gpiozero import Button take_pic_btn.when_pressed = take_picture ``` -1. We need to write these two functions so that the buttons have something to do when they are pressed. Functions are usually written at the start of a program immediately after the `import` statements. Add the functions, but with some placeholder code to just print a message when they are pressed, so we can test them. +1. We will write these two functions so that the buttons know what to do when they are pressed. Functions are usually written at the start of a program immediately after the `import` statements. Add the functions, but with some placeholder code to just print a message when they are pressed, so we can test them. ```python def next_overlay(): @@ -57,10 +56,21 @@ from gpiozero import Button ![Test the buttons](images/test-buttons.png) -## Add an overlay +## Add fun overlays + +1. The All Seeing Pi isn't a normal photo booth. The second button we set up, `next_overlay_btn`, is used to change between 'overlays' or funky additional pictures to make your photos look cool. Here is an example of a picture taken with an overlay: + + ![Rik with pigtail overlay](images/rik-picture.png) + + You can make your own overlays or we have provided some ready made ones that you can download + ## Change overlays with a button +## Take a picture when button pressed + +from picamera import PiCamera + ## Tweet picture ## Create a GUI