The image above depicts the use of RFID and sound on the NXT brick. This simple program starts out with implementing the RFID sensors and connecting them to a Logic block. The input we are looking for in this case is the 'AND' operator. We then connect to a Switch block which contains our first sound (can be any sound) and a simple motor movement. When we pass the RFID keyfob (any) transponder before the RFID sensor, out robot plays a sound and moves forward.
The second stage of the program does pretty much the same thing, in reverse, but with one key exception; we use a second keyfob transponder. This was done to experiment with using multiple transponders to see how it would work. The key thing to remember when using multiple transponders is to be certain to do a "Live Update" and click the "Current Transponder" button in order to uniquely identify each transponder. Sound, movement, just about anything is possible using RFID on the NXT.
So i had a chance to finally play around with the RFID sensor. Yeah, yeah! It is certainly exciting. The RFID sensor was easy to implement and use, once imported. Importing was easy as well, i simply used the built-in block 'Import and Export' wizard.
With that in mind, here is a simple program that illustrates how to control the NXT with RFID.
Start out by displaying a message. Then, implement the RFID sensors and connect them with Data Wires. Pass the value from the RFID sensors to Data Wires on a Compare Block that will determine the state in which the robot is in, i.e., 'Stop' or 'Go'. We then connect the Data Wires to a switch which contains our movement. The movement in this case is simple, just a 'jog' forward, say something ("Bravo", in this case), and then execute a sharp left turn. That's about that.
How It Works: Run the program, and then pass the RFID transponder before the RFID sensor. Once read, the robot does his little run and turn move and then stops and awaits further instructions.
Clearly, RFID on NXT has infinite possibilities. We can have the robot carry out various tasks, use multiple transponders, 'go here, do this', identify objects using RFID, etc. Let your imaginations go wild with it. The RFID sensor does not disappoint and i am eager to delve deeper into more experiments with robotics and RFID.
LEGO® MINDSTORMS® NXT® Power Programming: Robotics in C is a very good book. First things first, it will help if you know the C programming language before delving into this book. The book does not offer end-of-chapter exercises or many code examples. There is certainly an abundance of code snippets, but for a complete novice, this may not be enough. Additionally, if the desire is to learn NXT-G (the software that is supplied with the NXT brick for programming), this book is not the best choice for that. There is very little on NXT-G here.
What this book does offer however, is certainly a guide to some great programming on the NXT® brick using NXC -- Not eXactly C - a C-like language developed from the C programming language. There is also NBC -- Next Byte Code -- which is an Assembly language that can be used for NXT® brick development as well. The book covers these topics in sufficient detail and offers build instructions on several robot inventions. It also covers:
* BricxCC, a full featured programming environment * Sensors and Motors * Utilities for Music, Sound Sampling, Graphics and more * Building Robots without Bricks * Handheld Arcade Games on the NXT * An Intruder System * NXT to NXT Bluetooth communications * NXT to Bluetooth devices
All in all, this is a good guide to NXT and how to get your robotic inventions up an running. NXC is a great language to learn and use in LEGO® MINDSTORMS® NXT® programming. This book covers probably every aspect of the language, i.e., setup, compiling, programming, and running your creations. Additionally, the book is written by John C. Hansen -- the creator of the NXC language. Enjoy.
SeTH-1 as a 'Hunter'. Got the idea from NXTprograms, decided to implement it for fun as well as to check out some of the light sensor's capabilities. Using this program gave me an idea for another program which i am currently working on -- actually almost done with -- using the ambient light in a space to determine what SeTH-1 does; i.e., go forward, reverse, etc.
At any rate, here's a short video demonstrating the hunter in action.
The idea is to seek out the objects -- in this case the ball. Based upon a pre-determined criteria, ball color, the robot decides what to do with it: Blue? Identify it as being 'Blue', push it away, seek out red ball. Red? Identify it as being 'Red' and hold on to it.
So i've been working on (experimenting) with SeTH-1 and robotics in general, and decided to add a quick post including some pictures and a video of SeTH-1 in action. One of the primary things that i have been trying to accomplish, is to combine various algorithms so that SeTH-1 can perform several tasks using different methods. For example, combining voice-commands with pre-programmed commands that will allow for varying behaviors.
SeTH-1 as he currently looks.
SeTH-1 on NXT Test Pad, an earlier configuration.
SeTH-1 as is, currently has the ability to 'see' his environment while running around exploring. He is also designed to avoid obstacles, look for a better path to explore, make a comparison if more than one favorable path exists, and then chooses the optimal path.
Too, SeTH-1 follows some simple voice commands that are merely experiments with giving/receiving voice directions (additional work required). There is also an incomplete bit of work with Bluetooth BT that is designed to send a message to a Bluetooth device, based upon certain criterion.
Finally, there is a bumper added to SeTH-1 that allows him to make split decisions on what to do if he runs into an obstacle -- turn around and go a different way.
Introducing SeTH-1, the new addition to the family. Got the kit and constructed him and is in the process of tinkering with the software and programming him. i have also setup my environment so that i can program him using leJOS - Java for NXT bots. In addition, i will be using NXC -- the RobotC version of the C programming language in an experimental capacity. Lots of good times ahead i must say. Certainly looking forward to all the fun that this will provide. i will add a full post with a complete review of the entire process in the near future. Too, i may add some of the programs that i write, given that they are interesting enough.