Showing posts with label MINDSTORMS. Show all posts
Showing posts with label MINDSTORMS. Show all posts

Sunday, November 20, 2011

LEGO CAMPER

SAW IT - BOUGHT IT - BUILT IT - LOVE IT!


The Lego Camper model is one of the best ones I ever built. And I did built a lot. It comes along with so many details and special parts, which result in approx. 1300 pieces. Brilliant.


Lego T1 Camper Model



Friday, December 03, 2010

LEGOMANIA

There is no way to pass a Lego shop without checkin' it out - or even worse - buying more Lego stuff. But anyway, I needed to have Buzz Lightyear and bought the package that contained him: the pizza planet jeep. It's cool because it contains a pizza canon. If you pull at the rear it shoots pizza's from the front.

jeep - rear
driver's seat
jeep - rear
dino's seat
famous buzz lightyear

Sunday, October 10, 2010

NXT VEHICLE

I just tested the first pieces of code for my NXT vehicle. Right now it's just avoiding any obstacles. During the next weeks I'll expand the code towards some compass navigation stuff. 


Saturday, October 02, 2010

NXT NAVIGATION

I just built another NXT prototype to test a few programs in terms of compass navigation. The vehicle carries two ultrasonic sensors, one light and the compass sensor. Apart from that the intention was to keep the setup as simple as possible. I'll try the code stuff during the next weeks.


NXT VEHICLE


The building instructions can be found on HUMYO.



Sunday, September 06, 2009

MINDSTORMS NXT BEAUTY

Beim letzten Testrun machten wir Fotos vom NXT die mir besonders gut gefallen.

During the last testrun we made some shots of the NXT which I like a lot.



Saturday, September 05, 2009

MINDSTORMS NXT

Mal wieder ein neues Projekt: auf Basis einer älteren, von mir entworfenen Version habe ich einen neunen, fahrbaren Bot konstruiert. Er soll als autonomes Fahrzeug verschiedene Aufgaben lösen können. Ausgestattet ist er mit jeweils einem Licht-, Kompass-, Tast-, Schall- und Ultraschallsensor. Für den Code verwende ich JAVA / LEJOS. Die Code Basis (noch nicht schön aber reicht zum experimentieren) habe ich auf HUMYO bereitgestellt.

Another project: based on a former version I built a new, mobile bot. It will be an autonomous vehicle that can solve different tasks. It is equipped with light-, compass-, touch-, sound-, and ultrasonic- sensors. The code will be based on the JAVA / LEJOS library. The code basis (not perfect but enough for experimentation) can be found on HUMYO.









Saturday, December 27, 2008

MINDSTORMS CATERPILLAR

I enhanced the code a little bit that the cat can move without seriously hitting any objects. It is steered by the ultrasonic-, touch- and light sensor. I wrote a Java class to let the cat find a black spot by avoiding barriers. It’s kind of an ad hoc code, I’ll optimise it during the next days and will let it look a bit more organised.

After reorganising the code I think it’s a good basis to add more intelligence to it, maybe something for remembering the route and optimising the path.

But for now it does it’s job:



Java class:

package tospinout;

import lejos.nxt.*;

/**
* 2008-12-27 author 2spinout
*/

public class Cat
{
static TouchSensor ts = new TouchSensor(SensorPort.S3); //initialize Touchsensor
static UltrasonicSensor us = new UltrasonicSensor(SensorPort.S4); //initialize Touchsensor
static LightSensor ls = new LightSensor(SensorPort.S2); //initialze Lightsensor

//drive train
public static void main (String[] aArg)
throws Exception
{
// PortA = Motor.A = ultrasonic movement motor
// PortB = Motor.B = left driving motor
// PortC = Motor.C = right driving motor
// Port1 = SoundSensor
// Port2 = LightSensor
// Port3 = TouchSensor
// Port4 = UltrasonicSensor

LCD.drawString("2spinout",3,4);
Thread.sleep(2000);
ls.setFloodlight(true);

for(int COUNT = 0 ; COUNT < 20 ; COUNT += 1)
{
int stop = 0;
int light = 100;

Motor.A.setSpeed(400);
Motor.B.setSpeed(400);//720=2RPM
Motor.C.setSpeed(400);
Motor.B.forward();
Motor.C.forward();
Thread.sleep(1000);

do {
LCD.drawString("--> forward",3,4);
for(int count2 = -90 ; count2 < 91 ; count2 +=45)

{
light = ls.readValue();

if ((us.getDistance() < 45)|| (Motor.B.getActualSpeed() <390) || (Motor.C.getActualSpeed() < 390)||(light < 40)||(ts.isPressed()==true))

{
Motor.B.stop(); //stop driving engines
Motor.C.stop();
stop = 1;
}
Motor.A.rotateTo(count2);
}

Motor.A.rotateTo(0);
if (light<40)
{
break;
}

} while(stop != 1);

if (light<40)
{
break;
}
Thread.sleep (1000);


//turn back
Motor.B.setSpeed(400);//720=2RPM
Motor.C.setSpeed(400);
Motor.B.backward();
Motor.C.backward();
LCD.drawString("<-- backward",3,4);
Thread.sleep (1000);
Motor.B.stop(); //stop driving engines
Motor.C.stop();
Thread.sleep (1000);

//find best way / best distance
int left = 0;
int right = 0;

//check left
Motor.A.rotateTo(-90);
left = us.getDistance();
Thread.sleep(500);

//check right
Motor.A.rotateTo(90);
right = us.getDistance();
Thread.sleep(500);

Motor.A.rotateTo(0);
Thread.sleep(500);

if (left>right)
{
//turn left
Motor.B.setSpeed(400);//720=2RPM
Motor.C.setSpeed(400);
Motor.B.backward();
Motor.C.forward();
LCD.drawString("-^ turn left",3,4);
Thread.sleep (1200);
Motor.B.stop(); //stop driving engines
Motor.C.stop();
Thread.sleep(1000);
}

else
{
//turn right
Motor.B.setSpeed(400);//720=2RPM
Motor.C.setSpeed(400);
Motor.B.forward();
Motor.C.backward();
LCD.drawString("-v turn right",3,4);
Thread.sleep (1200);
Motor.B.stop(); //stop driving engines
Motor.C.stop();
Thread.sleep (1000);
}

}

ls.setFloodlight(false);

}
}

Friday, December 26, 2008

NXT GOES JAVA

Due to the limited possibilities you have with the Lego Mindstorms software I just converted to the leJOS Java Virtual Machine and also flashed the NXT brick with the corresponding firmware.
I think it will give me much more options in coding functionalities. In addition to that I’m using the Eclipse JDK. The firmware flashing and installation of the leJOS was very quick but I have to admit that the correct Eclipse setup took quite a while. It’s just because I never used it before.
As this is all done now I’ll set up the first projects. Below you’ll find my first sample:

package tospinout;

import lejos.nxt.*;

/**
* 2008-12-26 author 2spinout
*/

public class Cat
{

public static void main (String[] aArg)
throws Exception
{
// PortA = Motor.A = ultrasonic movement motor
// PortB = Motor.B = left driving motor
// PortC = Motor.C = right driving motor
// Port1 = SoundSensor
// Port2 = LightSensor
// Port3 = TouchSensor
// Port4 = UltrasonicSensor

LCD.drawString("2spinout",3,4);
Thread.sleep(2000);

Motor.B.setSpeed(720);// 2 RPM
Motor.C.setSpeed(720);
Motor.B.forward();
Motor.C.forward();


Thread.sleep (5000);
Motor.B.stop();
Motor.C.stop();

}
}

Sunday, December 14, 2008

MINDSTORMS

I’ll try a project with Lego Mindstorms during the next weekends. I ordered a book that should teach me how to code the NXT model with Java. I’m looking forward to the results. As motivation I already played a little bit: