I heard about a new graphical environment for Arduino boards, called ModKit, ready to emerge from alpha testing. Want to teach your kids (or a club) to program their Arduino robots? This is the best tool for the task. Easy to use blocs stack together much like the old Lego Mindstorms GUI, making programming fun to explore. Then you can see the generated Arduino code, modify it if needed and upload it directly from the browser. Oh, did I mention you can use it online? Your code will be saved in your account and you can access it from any computer in the world. Nice, huh? Can't wait to try it out with the Robot Builder's Shield and then with the uBotino controller!
Update: March 28th, 2011.
Yesterday I tried out the Beta Preview of the Modkit. Hard to work without Variable blocks, Servo blocks, Motor blocks... and after about half an hour of hard work I discovered I can't save anything. Oh well, clicked on the Feedback button and I let the guys know how are things going. Well, surprise-surprise! I got an invite to see how the old Alpha Modkit works. After another hour of more hard work, this time with many saves, the code was ready to download into the newly made LMR-SH-uBotino robot. Guess what? It worked! Almost perfectly actually. The only odd thing that happened was the servo moved when the Speaker played a note (like a beep). The funny thing was I was telling the servo to move to 0 degrees right after the beep and the servo was moving to 180 degrees, then move to 0 degrees and I was like whaaat? But as soon as I removed the PlayNote block everything worked fine.
I was told that the old Alpha phased out (code was re-written completely) and there will be a new Alpha test group (with less people) and as soon as something works perfectly on the Alpha, it gets moved to the Beta preview. They are working hard to have new stuff added every week so pretty soon we will all be able to have code written in modkit for our robots. Cool!
And now, have a look a how the code for my robot looks in Modkit Block Editor: (I manually scrolled the code and captured the screen, then I cropped and pasted the code in the first screen capture, so the code continues in side by side columns like.)
And here is the code from the Modkit Code Editor:
servoSetup(PIN9);
forever{
digitalWrite(PIN13,HIGH);
digitalWrite(PIN5,HIGH);
digitalWrite(PIN8,LOW);
digitalWrite(PIN6,HIGH);
digitalWrite(PIN7,LOW);
Distance = analogRead(0);
sendMessage("Distance: ");
sendMessage(Distance);
if((Distance) > (300)){
digitalWrite(PIN5,LOW);
digitalWrite(PIN6,LOW);
digitalWrite(PIN7,LOW);
digitalWrite(PIN8,LOW);
servoAngle(0);
delay(300);
sendMessage("Left");
counter = 0;
Direction = 0;
prevDist = 0;
repeat(3){
Distance = analogRead(0);
if((Distance) > (prevDist)){
prevDist = Distance;
Direction = counter;
}
counter = (counter) + (1);
if((counter) == (1)){
servoAngle(90);
sendMessage("Center");
}
if((counter) == (2)){
servoAngle(180);
sendMessage("Right");
}
delay(1000);
}
servoAngle(90);
delay(300);
if((Direction) == (0)){
digitalWrite(PIN5,HIGH);
digitalWrite(PIN8,LOW);
digitalWrite(PIN6,LOW);
digitalWrite(PIN7,HIGH);
delay(1000);
digitalWrite(PIN5,LOW);
digitalWrite(PIN8,LOW);
digitalWrite(PIN6,LOW);
digitalWrite(PIN7,LOW);
}
if((Direction) == (2)){
digitalWrite(PIN1,LOW);
digitalWrite(PIN1,HIGH);
digitalWrite(PIN1,HIGH);
digitalWrite(PIN1,LOW);
delay(1000);
digitalWrite(PIN5,LOW);
digitalWrite(PIN8,LOW);
digitalWrite(PIN6,LOW);
digitalWrite(PIN7,LOW);
}
}
digitalWrite(PIN13,LOW);
delay(500);
}
Neat, huh? I guess kids will love to play writing code! I know I am!
https://www.youtube.com/watch?v=RNqDoniUD9I