Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

January 29, 2013

Autonomous Anti-Mouse Sentry Turret

For Bad Ideas I built a computer controlled anti-mouse sentry turret.  The turret uses a video feed from a webcam and a slightly modified version of the Project Sentry Gun Processing code to track mouse-sized objects that move across the camera's field of view.  It fires at the objects using a hacked electric airsoft gun on a pan/tilt servo platform.


January 28, 2012

Arduino Game Port Interface

A while back I got my hands on an old analog PC joystick, and since then I have been meaning to build an adapter make the joystick work over USB.  The adapter I finally built consists of an Arduino connected to a game port I hacked off an old sound card.  The Arduino reads the analog (x and y movement) and digital (buttons) inputs and then sends them to the computer over serial.  Then a Processing script running on the computer reads the serial data, and converts it into mouse movements and clicks using the Java Robot class.


August 29, 2011

Tree Climbing Robot

After I got comfortable programming and building with an Arduino, I used my newly acquire microcontroller skills to build a robot.  Using a microcontroller, four high-torque DC gear motors, spiked legs, a linear actuator, rotation sensors, and 3 L298 H-bridge circuits, this robot can climb up trees of varying diameter.  The very long build log follows.



The robot in action:



August 16, 2011

Predator-Prey Simulation

Since I started programming, I have thought it would be interesting to attempt to approximate life within a computer program.  I started this project on my own, but finished it, collected data from it, and wrote a paper on if for my final CS class project.  

What my final program does is create a virtual Petri dish with two types of cells in it: predator cells and prey cells.  As the cells move around in their virtual environment, the predator cells try to chase down the prey cells, and the prey try to escape the predators.  If the predators do not eat for a long time, they die of starvation.  As the cells move in the simulation, the also replicate.  All of the cells, both predator and prey, have two individual attributes: sight radius and movement speed, which are passed on from parent cells to child cells.  However, as the cells replicate, there is a small chance that the child cells "mutate."  In other words, one or both of their attributes has a slightly different value than the parent cell's attributes.  These random mutations allow for natural selection to occur within the simulation, provided it runs for long enough.  The most effective predators will survive the longest, and therefore produce the most offspring, so their desirable attributes proliferate.  The same applies to prey cells that can escape most easily.  As the simulation runs, it outputs the average attributes of all of each type of cell to a text file at regular intervals.  If the simulation is run for a long period of time, these values can be evaluated, and one can see if natural selection occurred or not, on average.



June 23, 2011

GUI Controlled LED Matrix



I recently got an Arduino Uno, and it quickly became my favorite toy.  After learning the basics of how the platform operates, I became interested in interfacing the Arduino with personal computers.  After seeing a large number of LED matrix projects on Instructables and the rest of the web, the LED matrix seemed like a perfect project to attempt to interface with a computer.  




January 15, 2011

Artillery Game

This is a basic artillery game I wrote in python.  There are still some minor issues I need to fix, but it works and is playable.  It includes wind, movement, and variable-height (but not shape) terrain.

November 6, 2010

Python Game and Cipher

I wrote this simple game in Python using the tkinter graphics module.  This is my first attempt at writing a game, so it is very basic but (hopefully) entertaining at the same time.