ROBOTC.net Blog  

ROBOTC News

Archive for January, 2012

Mindsensors RCX Multiplexer controlled via Android and ROBOTC

with one comment

[All work done by Burf, original link: http://www.burf.org.uk/2012/01/01/mindsensors-rcx-multiplexer-controlled-via-android-and-robotc/]

We found another one of Burf’s work on his blog. If you don’t know Burf, he was the creator of a previous Cool Project on our blog, LEGO George.

Here’s another amazing post from his work that utilizes the RCX Multiplexer and an Android phone!

His blog reads,

——————————————————————————————————————————————

As you may be aware I have been building a Robot called Wheeler out of old parts (old grey and RCX 9V motors etc).  I was hoping to have it finished over the Christmas break but had hit a small issue with driving the wheels with the new weight of the body.  Anyway what I did managed to get up and running is the top half of Wheeer and the controller which is a Android phone (Dell Streak).

Mindsensors RCX Multiplexer

I was utterly impressed with the Mindsensors.com RCX Multiplexer and using Xanders driver suite (check BotBench) how fast I was up and running.  I wish there was a way to run the RCX Multiplexer off the NXT power supply but thats a small thing compared to how useful it is.  I wish I had 3 more of them so that I could control 16 RCX motors!

Android NXT Remote Control

So to try and work out how to control the NXT via Android, I stumbled across the NXT Remote Control project which is free to download.  This uses Lego’s Direct Commands to control the 3 motor ports on the NXT.  This means it bypasses your own code and you have no control over it.  However, what I managed to do is reduced it down to a very simple program that sends messages to the NXT which you can deal with in your own program.  In RobotC, it sends messages that are compatible with the MessageParam command and so you can send a message ID and 2 params to the NXT and deal with them in robotC anyway you want to.  Code will be available soon once I have tidied it up.

Written by Vu Nguyen

January 20th, 2012 at 2:24 pm

Posted in Cool projects,NXT

Major Improvements in ROBOTC 3.05 for VEX Cortex

without comments

ROBOTC 3.05 contains a number of enhancements that should be very exciting for VEX Cortex users. This is a free update for all ROBOTC for Cortex and PIC users (yes, even if you were using 2.3x)!

The ROBOTC 3.05 installer now includes the VEX Cortex and Prolific USB-to-Serial drivers. You no longer need to remember to download and install these separately.

We’ve heard your feedback! The new “Automatically Update VEX Cortex” option will detect if your Cortex is out-of-date, and automatically download the latest version of the Master CPU and ROBOTC Firmware files if needed. There’s no need to go through the long process of manually downloading each firmware, or put the VEX Cortex in “bootload” mode! The same functionality has been implemented for the VEXnet Joysticks as well.

Also included is a new version of the Master CPU Firmware from VEX Robotics. This version restores the functionality from the 2.x firmware, which allowed programs to run even when VEXnet was turned on (but not used).

New Standard Models! Standard models for the popular Robotics Academy robots and PLTW Training Testbeds have been added, and can be used to automatically configure all of the motors and sensors, hassle free.

New and improved sample programs! New sample programs for the VEX Mecanum Wheels and Line Tracking Kit have been added. others have been improved.

You now have the ability to give your robot a custom name. This will be a crucial enhancement for competition teams, and should be helpful for classroom settings, too.

Written by Jesse Flot

January 13th, 2012 at 12:15 pm

ROBOTC version 3.05 has been released!

with one comment

Hi all,

We’ve just released ROBOTC 3.05. Head on over to the download pages to download the latest version!

Change log:

NXT:

  1. Allow “File Management” window to play multiple sound files and not just a single file.
  2. Fix bug in implementation of NXT intrinsic function “I2CGetSensorInfo”.
  3. Holding down gray EXIT button on NXT will now eventually power off the NXT.
  4. Re-enable support for “sendMessage” on NXT.
  5. Updated FTC Joystick Driver to include diagnostics and added a critical section around the “no joystick data” fields to prevent false starts.
  6. “DrawEllipse” was broken for emulator. ‘short’ variable was overflowing; ‘long’ was needed.
  7. Constant for total number of motors for Tetrix was incorrect (too small). Result is some user defined names for 12V Tetrix motors were not being defined. Applies when Tetrix motor controller was configured on sensor port S3 or S4. Now Fixed.
  8. Included range checking on game controller joystciks to fit in one byte. Few users reported errors about seeing 2-byte joystick values.

VEX:

  1. New Automatic Firmware Updater for VEX Cortex – Choose one menu option and ROBOTC takes care of the rest (putting into bootload/downloading both master and ROBOTC firmware)
  2. Updated installer to automatically install the VEX Cortex drivers and Prolific USB-to-Serial Drivers upon install.
  3. Updates to the RVW Natural Language files to include remote control and microcontroller button commands.
  4. New standard model files for PLTW Testbeds
  5. By default “Com Port lists” will not include all serial ports. They will only the ports that match the current platform/use selection. A registry preference (“Advanced Environment” tab) can be used to restore to the current (3.04 release) of including all ports.
  6. Updated Error Messages for Firmware/Program downloads.
  7. New Sample Programs for 4-motor joystick control.
  8. Added new variable “bStopTasksBetweenModes” to allow VEX users to disable the allTasksStop function from running between autonomous and teleop modes

General/Other:

  1. Compiler was not generating error when “typedef” variable was used in an expression. Fixed.
  2. ADD “__NAME__” to preprocessor predefined variables.
  3. Fix code generation bug for “const string” array variables. Compiler would incorrectly use empty string instead of reference to array variable in constant pool.
  4. Rightmost character of block of italic formatted source file had “slant” clipped by the background of the next block of text. Fixed.
  5. Expand opcodes for “shift left/right” to support ‘long’ variable as shift size amount.
  6. Fix definition of “degreesToRadians” intrinsic. It was not working when the parameter was a numeric constant.

Written by Vu Nguyen

January 13th, 2012 at 12:07 pm

Skype-Controlled Mindstorms NXT Car

without comments

First of all, let me introduce myself: I’m Leon (aka dimastero/ dimasterooo), and I was recently invited to contribute to this blog. So as, my first post, I’d like to tell you about my new Skype-controlled LEGO Mindstorms NXT Car.

I’ve been creating websites for a while now, and I was trying to think of a way to combine it with Mindstorms NXT. This project is the result of that. The project’s webpage is fairly simple – it’s got three arrows (one forward, two to the sides), a start button, and a stop button. It’s also got instructions on it. Clicking the start arrow will begin a Skype conversation with my computer, after which you should share your screen; the NXT standing in front of my computer can then “see” the webpage with the arrows via your computer.

That’s where the cool part kicks in – when you any one of the arrows or the stop button, the page will change to a different shade of gray. This shade of gray is then picked up by the NXT, which turns it into a Bluetooth message for the other NXT on the car. The car then drives in the direction the user tells it to, while remaining within a fenced off area where the webcam can see it.

So, until January the 18th, you can drive a LEGO Mindstorms NXT car, from the comfort of your own home. To learn how and find out more about this project, click the link below:

http://worldofmindstorms.com/2012/01/04/interactive-skype-controlled-mindstorms-nxt-car/

Written by DiMastero

January 10th, 2012 at 9:00 am

Posted in Cool projects,NXT

Facial recognition using an NXT and an iPhone

with 2 comments

This is a robot that uses Face Recognition  in order to follow around a human. It uses an iPhone in conjunction with an NXT. Take a look!

You can download the Xcode Project and ROBOTC code here:  http://code.google.com/p/follow-me-robot/

How it works

The iOS code uses iOS 5′s face detection algorithm to find the position of the face within the video frame.  I then needed a way to communicate with the NXT robot and steer it.  Since I didn’t want to go through the trouble of communicating through bluetooth with it (and I don’t know how to do it!), I chose to communicate with the NXT using the Light Sensor that comes with the NXT.

If I want the robot to go to the left, I dim the lower portion of the iPhone screen and if I want it to go to the right I increase its intensity.  Also, when the phone does not see a face, I turn the lower portion of the screen black.  This tells the robot that it needs to not move forward and spin in-place until it finds a face.

In the ROBOTC code, I also make use of the sound sensor to start and stop the robot.  A loud sound is used to toggle between start and stop.

The ROBOTC and iOS code is very simple.

ROBOTC code

(Code subject to change. Download the latest version of the code!)


#pragma config(Sensor, S1,     lightSensor,         sensorLightInactive)
#pragma config(Sensor, S2,     soundSensor,         sensorSoundDB)
#pragma config(Motor,  motorA,          mA,            tmotorNormal, PIDControl, encoder)

task main()
{
wait1Msec(50);                         // The program waits 50 milliseconds to initialize the light sensor.
/*
float x;
while (1)
x = SensorValue[lightSensor];
*/

float minLight, maxLight, d, a, c, v, alpha = 0.01, stopGo=0.0;
int l, sound, startMotors = 0, lostFace, faceFound = 0;

a = 0.60;
minLight = 9;
maxLight = 34;
lostFace = 5;
v=20;

c = (minLight+maxLight)/2.0;

while (1) {

sound = SensorValue[soundSensor];
if(sound > 85) {
startMotors++;
startMotors %= 2;
wait10Msec(50);
}

l = SensorValue[lightSensor];
d = a*(l-c);

faceFound = (l > lostFace) ? 1:0;

stopGo = alpha*faceFound + (1-alpha)*stopGo;

motor[motorB] = (-d+v*stopGo)*startMotors;
motor[motorC] = (d+v*stopGo)*startMotors;
}

Written by ramin

January 9th, 2012 at 8:58 am

Posted in Cool projects,NXT