Scratch Retaliation

Always wanted to shoot foam missiles with your Raspberry Pi, but didn’t have a automated build system handy to trigger it? Would you rather drag blocks in Scratch to make programs to attack your foes?

Introducing Scratch Retaliation!

Extending the Retaliation idea used in Raspberry Pi Retaliation, this program allows you to use the Scratch programming language to create programs on the Raspberry Pi to control a Dream Cheeky rocket launcher.

One of the first things my son asked after getting the Raspberry Pi Retaliation setup at home was whether we could write a program to control the missile launcher from Scratch. As it turns out, with a little bit of Python coding this isn’t hard to do at all! See below for instructions on how to get your own Scratch Retaliation setup.

Hardware

Setup

Step 1 - Install pyusb:

The python-usb yum module is not new enough to work with the retaliscratch code. Instead download the source for 1.0 from pyusb.

Untar into a directory, then install pyusb with:

# sudo python setup.py install

Step 2 - Download retaliscratch:

# wget https://raw.github.com/cognitivegears/retaliscratch/master/retaliscratch.py
# chmod +x retaliscratch.py

Step 3 - Install scratchpy

First, install pip for python:

# curl http://python-distribute.org/distribute_setup.py | sudo python
# curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python

Then install scratchpy

# sudo pip install scratchpy

Step 4 - Download the example Scratch program

# curl https://github.com/cognitivegears/retaliscratch/blob/master/example.sb

Step 5 - Connect and test

Connect the missile launcher (I used a powered USB hub) and test with a command such as sudo ./scratchpy

Load the example.py in Scratch and if needed enable remote sensor connections by clicking on “Sensing”, then right clicking on the X sensor value block and choose “enable remote sensor connections”.

Click the green flag and test by clicking on the Scratch sprite.

geekteacher asked:

Hi, got this link off the Raspberry Pi website. Been trying to get USB Missile launcher to work with the Retaliation script. Currently getting 'No module name core' error when running script even though I have installed libusb-1.0. Any ideas please?

Hi geekteacher. My guess is that you also have the older version installed along with 1.0. I’d suggest trying to do a sudo apt-get remove python-usb, then install libusb-1.0 from https://github.com/walac/pyusb to see if that helps. Good luck and please let me know whether that works for you!

Raspberry Pi Retaliation!

After finding Retaliation, a project with a creative solution to build failures in a development team, I knew I had to get it setup for my team. The RPi makes a great fit for this project as well, since it is small, lower power and has both the USB and networking chops to get it done. So when I went looking for a solution for punishing my coworkers, I just had to give it a try. Turns out, hooking it all up was simplicity itself.

Hardware

Setup

Step 1 - Install pyusb:

The python-usb yum module is not new enough to work with the retaliation code. Instead download the source for 1.0 from pyusb.

Untar into a directory, then install pyusb with:

# sudo apt-get install python libusb
# sudo python setup.py install

Step 2 - Download retaliation:

# wget https://raw.github.com/codedance/Retaliation/master/retaliation.py
# chmod +x retaliation.py

Step 3 - Connect and test

Connect the missile launcher (I used a powered USB hub) and test with a command such as sudo ./retaliation.py will

Step 4 - Modify the script as needed for your office & enjoy

UPDATE: Thanks so much to the Raspberry PI folks for linking to this article! I took the RPi & launcher into work yesterday, got a great reception - luckily everyone in my group is a good sport and doesn’t mind being shot with foam missiles from time to time. Ordered 2 more RPis for the office (still need to order the launchers and come up with something for stands) to get coverage for the work area, and so I can take my personal RPi back home.

UPDATE 2: See a video of the Raspberry Pi Retaliation in action!

Also, check out my new blog post about controlling the Raspberry Pi Retaliation from Scratch.

Thanks!

Raspberry PI / Arduino Serial Communications

Can’t wait for the Gertboard, or just don’t want to spend the money on one? With a bit of time and a few components, it is pretty easy to get your Raspberry PI communicating with an Arduino.

I have to admit, this is a bit of a “me too” post, as I followed the great instructions from this irongeek.com article in order to complete the setup. I ran into a few problems during the setup, however and thought an expanded set of instructions specifically for the serial setup was in order.

Read More

Quick Tip: Fritzing & Raspberry PI

Lately I have been playing with the open-source Fritzing tool (available for Mac, Linux & Windows) in order to document prototypes. Although I have run into a few problems, by and large it is an excellent tool for quickly creating diagrams. After doing some digging, I found that there is even a Raspberry PI part available from adafruit, along with some of their compoents (the PiCobbler, PiPlate, etc.) Grab it from:

https://github.com/adafruit/Fritzing-Library

Also, check out the tutorial on Building A Circuit to find out more about how to use the application.

Happy Fritzing!

RPi Text Triumvirate

Turn the @RaspberryPI into a great development environment!

With a few packages and a bit of time it is possible to significantly improve the usability of the Raspberry PI for development.

The Text Triumvirate is a great article for getting a text-based development environment setup. Since I use it all the time at work, I decided to see how much could translate onto the RPi. As it turns out, almost all of it! See the following screenshot for the work-in-progress version of my current setup:

Some of the advantages of this setup:

  • Persistence - tmux integration means that I can leave my RPi running and when I reconnect from a ssh terminal get right back to where I left off.
  • Flexibility - I can move between an ssh session, console, or xterm and have the same environment setup
  • Ease of use - Replacing the default shell and installing an improved text editor improve the overall usability of the system
  • Looks awesome! - show off your RPi in style.

Read More

Setup this blog to share some of my recent home projects, currently mostly having to do with the Raspberry Pi and Arduino.
Zoom Info
Camera
SONY NEX-5N
ISO
2000
Aperture
f/5.6
Exposure
1/100th
Focal Length
55mm

Setup this blog to share some of my recent home projects, currently mostly having to do with the Raspberry Pi and Arduino.

To Tumblr, Love Pixel Union