Posts Tagged ‘RobotC’

Friday Night Robotics – Competitions all weekend long!

Posted by Erin, the RobotGrrl on Saturday, December 5th, 2009

For FNR this week, there are many competitions going on! Thursday was Physics I Team Design Lab Challenge Sessions, Friday was a FTC Competition and Saturday is a FLL Competition! After Saturday is the competition that is the most worthless but “necessary” … final exam(s). -_-

Friday, the FTC competition was amazing! FTC is FIRST Tech Challenge, and it’s where middle school and high school students build robots out of metal and some lego parts. The brain of the robot is an NXT, and they can program it in either RobotC, NXT-G, or LabView with the NXT toolbox.

The field is 12 feet by 12 feet, and this year’s challenge is called HotShot! The robots have to score wiffleballs into the zone in the middle, the nets above the zone, or the containers off to the side of the field. The wiffleballs are released onto the field when a holster tube is pushed. Yellow wiffleballs are better than white wiffleballs.

There’s a 30 second autonomous mode at the beginning of the game, followed by a teleoperated mode. The robots are controlled by a logitech controller that has joysticks and buttons (hahaha, what a lame description), which goes into software called the Field Controller Station. This software is on the laptop that the team supplies. The software then communicates via Bluetooth to the robot.

On the technical side of things, the Bluetooth works great if you have one robot. If you have 40 robots connected with Bluetooth, the air gets too cluttered. We ran into some problems the other day when robots started moving on their own and some teams would be disconnected if they switched from autonomous mode to teleoperated mode.

Problems or not, it was fun. Apparently it ran more smoothly than it did last year, so that was fantastic! Plus, one of the teams that I was helping gave me one of their team t-shirts! The music was great, and the event was streamed live from WCKN onto the internet!

There are 79 pictures that were taken live at the event up on team229robotics.com.

The FLL competition is today, Saturday December 5th. You can tune in to the live stream right here and subscribe to team229robotics.com’s RSS feed to have updated live blogging images as they come in!

Posted in: Other, Programming, Projects, Robot, School.

Friday Night Robotics – MusicBox!

Posted by Erin, the RobotGrrl on Sunday, October 11th, 2009

This Friday I had the most awesome idea of a weekend project ever! A 21st century MusicBox, using an Arduino and have blinking LEDs!

I had a Sparkfun box lying around, which is an ideal size for an Arduino and a WaveShield.

Friday Night Robotics - MusicBox!

I wanted to have LEDs outlining the box, so I went to work on it:

Friday Night Robotics - MusicBox!

Friday Night Robotics - MusicBox!

Just as a disclaimer- I designed it wrong, so the LEDs don’t work well. If you’re looking to follow my steps, DON’T DO IT! :P

Friday Night Robotics - MusicBox!

Friday Night Robotics - MusicBox!

Then, installing them into the box:

Friday Night Robotics - MusicBox!

It looks nice!

Friday Night Robotics - MusicBox!

Once all of the connections are made, it’s pretty tight in there:

Friday Night Robotics - MusicBox!

The problem though, is that I designed it so that all the LEDs are in series. Since al LEDs aren’t created equally, some suck up more power and therefore can’t share it with the others. This is what happened:

Friday Night Robotics - MusicBox!

It’s pretty sad! :( But, I think that I can fix it because I soldered the resistors together, not the actual LEDs together. :D I was too excited to start this project, so I didn’t bother to plan =) I guess planning would have been better, but it would also have been too boring.

I also worked on a NXT LED blinky thingy. There are these HiTechnic Protoboards that you can get, and basically you attach them to one of the sensor inputs, and you can control power to certain ports and such.

In this case, there’s 6 output pins that you can control. Sounds like an opportunity to use LEDs to me! :D

NXT + LEDs

This is what the setup looks like:

NXT + LEDs

It goes like this: NXT -> HiTechnic ProtoBoard Sensor Adapter -> 6 LEDs

In order to output instructions to the HiTechnic ProtoBoard, you need ‘drivers’, or headers. They’re located here.

Here is the code for the LEDs, in RobotC:

  1. #pragma config(Sensor, S1,     HTPB,                sensorI2CCustom9V)
  2. //*!!Code automatically generated by ‘ROBOTC’ configuration wizard               !!*//
  3.  
  4. /*
  5.   Crazy LEDs!
  6.   Erin K
  7.   Oct. 9th, 2009
  8. */
  9.  
  10. #include "drivers/common.h"
  11. #include "drivers/HTPB-driver.h"
  12.  
  13. byte theLEDs[] = { 0×01, 0×02, 0×04, 0×08, 0×10, 0×20 };
  14.  
  15. task main() {
  16.  
  17.   // Setup all the digital IO ports as outputs (0xFF)
  18.   if (!HTPBsetupIO(HTPB, 0xFF)) StopAllTasks();
  19.   wait1Msec(200);
  20.  
  21.   while(true) {
  22.  
  23.     // The delay time
  24.     int theTime = 50;
  25.  
  26.     // LEDs going up
  27.     for(int i=0; i<6; i++) {
  28.       if (!HTPBwriteIO(HTPB, theLEDs[i])) nxtDisplayTextLine(5, "ERR WRITE");
  29.       wait1Msec(theTime);
  30.     }
  31.  
  32.     // LEDs going down
  33.     for(int i=5; i>=0; i) {
  34.       if (!HTPBwriteIO(HTPB, theLEDs[i])) nxtDisplayTextLine(5, "ERR WRITE");
  35.       wait1Msec(theTime);
  36.     }
  37.  
  38.     alive();
  39.  
  40.   }
  41.  
  42. }

This is what the code does:

To wrap up this Friday Night Robotics, I checked out the Adafruit Ask an Engineer chat. It was pretty cool! I learnt about how LEDs work, and how much it costs to create a Teenyduino! Everyone should check it out, Saturday at 10:00PM EST.

The only things that I didn’t get to do that I wanted to was play with MANOI and the iRobot Create. I’m kinda worried that MANOI’s batteries are drying out as they haven’t been exercised in a while :S EEP!

Posted in: Art, Programming, Projects, Robot.