|
1 | | -#!/usr/bin/env python |
2 | | -from __future__ import print_function |
3 | | -from __future__ import division |
4 | | -from builtins import input |
5 | | - |
6 | | -''' |
7 | | -Build a Present Delivery System. Have a robot deliver your Christmas Presents! |
8 | | -
|
9 | | -https://www.dexterindustries.com/projects/giftbot-raspberry-pi-robot-delivers-christmas-gifts/ |
10 | | -
|
11 | | -In this project, we'll show you GiftBot, the Raspberry Pi Robot that will deliver your Christmas Gifts and bring cheer to your holiday season. We took the GoPiGo Raspberry Pi Robot, added some Jingle Bell Rock with the Raspberry Pi Speaker, and harnessed the power of three reindeer to deliver our gifts this year. A elf will ride on the GoPiGo as it makes its rounds. |
12 | | -
|
13 | | -No reindeer robot would be complete without a Red Nosed Rudolf: we added one with a Red Grove LED! |
14 | | -
|
15 | | -## License |
16 | | - GoPiGo for the Raspberry Pi: an open source robotics platform for the Raspberry Pi. |
17 | | - Copyright (C) 2015 Dexter Industries |
18 | | -
|
19 | | -This program is free software: you can redistribute it and/or modify |
20 | | -it under the terms of the GNU General Public License as published by |
21 | | -the Free Software Foundation, either version 3 of the License, or |
22 | | -(at your option) any later version. |
23 | | -
|
24 | | -This program is distributed in the hope that it will be useful, |
25 | | -but WITHOUT ANY WARRANTY; without even the implied warranty of |
26 | | -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
27 | | -GNU General Public License for more details. |
28 | | -
|
29 | | -You should have received a copy of the GNU General Public License |
30 | | -along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>. |
31 | | -''' |
32 | | - |
33 | | -from gopigo import * |
34 | | -import sys |
35 | | -import os |
36 | | -import subprocess |
37 | | -# from espeak import espeak |
38 | | -import atexit |
39 | | -atexit.register(stop) |
40 | | -led_pin = analogPort |
41 | | -pinMode(led_pin,"OUTPUT") |
42 | | - |
43 | | - |
44 | | -# Play some rock music. You can play any mp3 for other sound file |
45 | | -# with omxplayer. Change the full path name! |
46 | | -def play_rock(): |
47 | | - bashCommand = '''sudo omxplayer -o local /home/pi/rock.mp3''' |
48 | | - print(bashCommand) |
49 | | - subprocess.Popen(["sudo","omxplayer", "-o", "local", "/home/pi/rock.mp3"]) # Runs the bash command in the background. |
50 | | - |
51 | | -# Blink Rudolfs Nose! |
52 | | -def blink(times): |
53 | | - for each in range(0, times): |
54 | | - try: |
55 | | - digitalWrite(led_pin,1) |
56 | | - time.sleep(.5) |
57 | | - digitalWrite(led_pin,0) |
58 | | - time.sleep(.5) |
59 | | - |
60 | | - except IOError: |
61 | | - print ("Error") |
62 | | - |
63 | | -while True: |
64 | | - play_rock() |
65 | | - fwd() |
66 | | - blink(5) # Adjust this rate for however long you want the GoPiGo to run! |
| 1 | +#!/usr/bin/env python |
| 2 | +from __future__ import print_function |
| 3 | +from __future__ import division |
| 4 | +from builtins import input |
| 5 | + |
| 6 | +''' |
| 7 | +Build a Present Delivery System. Have a robot deliver your Christmas Presents! |
| 8 | +
|
| 9 | +https://www.dexterindustries.com/projects/giftbot-raspberry-pi-robot-delivers-christmas-gifts/ |
| 10 | +
|
| 11 | +In this project, we'll show you GiftBot, the Raspberry Pi Robot that will deliver your Christmas Gifts and bring cheer to your holiday season. We took the GoPiGo Raspberry Pi Robot, added some Jingle Bell Rock with the Raspberry Pi Speaker, and harnessed the power of three reindeer to deliver our gifts this year. A elf will ride on the GoPiGo as it makes its rounds. |
| 12 | +
|
| 13 | +No reindeer robot would be complete without a Red Nosed Rudolf: we added one with a Red Grove LED! |
| 14 | +
|
| 15 | +## License |
| 16 | + GoPiGo for the Raspberry Pi: an open source robotics platform for the Raspberry Pi. |
| 17 | + Copyright (C) 2017 Dexter Industries |
| 18 | +
|
| 19 | +This program is free software: you can redistribute it and/or modify |
| 20 | +it under the terms of the GNU General Public License as published by |
| 21 | +the Free Software Foundation, either version 3 of the License, or |
| 22 | +(at your option) any later version. |
| 23 | +
|
| 24 | +This program is distributed in the hope that it will be useful, |
| 25 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 26 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 27 | +GNU General Public License for more details. |
| 28 | +
|
| 29 | +You should have received a copy of the GNU General Public License |
| 30 | +along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>. |
| 31 | +''' |
| 32 | + |
| 33 | +from gopigo import * |
| 34 | +import sys |
| 35 | +import os |
| 36 | +import subprocess |
| 37 | +# from espeak import espeak |
| 38 | +import atexit |
| 39 | +atexit.register(stop) |
| 40 | +led_pin = analogPort |
| 41 | +pinMode(led_pin,"OUTPUT") |
| 42 | + |
| 43 | + |
| 44 | +# Play some rock music. You can play any mp3 for other sound file |
| 45 | +# with omxplayer. Change the full path name! |
| 46 | +def play_rock(): |
| 47 | + bashCommand = '''sudo omxplayer -o local /home/pi/rock.mp3''' |
| 48 | + print(bashCommand) |
| 49 | + subprocess.Popen(["sudo","omxplayer", "-o", "local", "/home/pi/rock.mp3"]) # Runs the bash command in the background. |
| 50 | + |
| 51 | +# Blink Rudolfs Nose! |
| 52 | +def blink(times): |
| 53 | + for each in range(0, times): |
| 54 | + try: |
| 55 | + digitalWrite(led_pin,1) |
| 56 | + time.sleep(.5) |
| 57 | + digitalWrite(led_pin,0) |
| 58 | + time.sleep(.5) |
| 59 | + |
| 60 | + except IOError: |
| 61 | + print ("Error") |
| 62 | + |
| 63 | +while True: |
| 64 | + play_rock() |
| 65 | + fwd() |
| 66 | + blink(5) # Adjust this rate for however long you want the GoPiGo to run! |
0 commit comments