Animatronic Pokemon

From Neuron Robotics Wiki

Jump to: navigation, search

Introduction

These animatronic pokemon where created for the 2011 WPI CDP. The electronics and mechanics where built by us and the skin was made by by Sam and Rae crafts[1]


Hardware

The Motors are all hobby servos. They where controlled by a DyIO + Bluetooth to Serial converter.

File:DyIO pokemon ctl.jpg

Software

The full software can be found here[2]. What is shown below is the code for one of the pokemon.

class Bulbasaur implements Runnable {
	// Constants
	private static final int BulbasaurHeadMax = 0;
	private static final int BulbasaurHeadMid = 37;
	private static final int BulbasaurHeadMin = 140;

	private DyIO myDyIO;
	private ServoChannel BulbasaurHead;
	private Random generator;
	
	public Bulbasaur(DyIO dyio){
		myDyIO = dyio;
		generator = new Random();
		BulbasaurHead = new ServoChannel (dyio.getChannel(23));
	}
	
    @Override
	public void run() {
		try {
		while(true){
			int action = generator.nextInt(4);
			BulbasaurHead.SetPosition(BulbasaurHeadMin, action);
			Thread.sleep(generator.nextInt(10)*1000);
			BulbasaurHead.SetPosition(BulbasaurHeadMax, action);
			Thread.sleep(generator.nextInt(10)*1000);

		}
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
}
Personal tools