Yet another new version (1.3) of the ROBOTC driver suite awaits your download from the usual source.
Changes for this version include:
New additions:
- Codatex RFID sensor driver + 2 test programs (thanks Sylvain + Oliver)
- Lego Temp sensor + 2 test programs (thanks Sylvain)
- Firgelli Linear Actuator + test program
- Mindsensors Power Meter + test program
Fixes:
- drivers/common.h: Added long uByteToLong(byte a1, byte a2, byte a3, byte a4)
- drivers/MSLL-driver.h: Fixed a comment
- HTAC-test1.c: Fixed display line (thanks Dave)
The drivers’ website is here: [LINK].
The documentation can be found here: [LINK].
You can download the software from the Source Forge page here: [LINK].
Hi Xander,
Maybe I’m just dense, but I’m having a hard time understanding how to use the Driver Suite with the HTPB (proto board from HiTechnic).
I’m trying to convert the examples from HiTechnic to use your Driver Suite (figured it would be a good learning experience). Unfortunately, my C skills were never phenomenal, so I’m having some difficulties understanding how to ReadIO and WriteIO.
Do you have any other tutorials? Or just the examples for the Driver Suite?
Eric
Is there anything in particular you are having trouble with? Is it the mask? What kind of examples would you like to be included with the next release of the driver? I am finishing up a few things on the Russian motor MUX, after which I was going to release the driver suite. However, if there are specific examples you’d like me to make and include, drop me a mail.
Xander
Hi Xander,
I’m thinking some ultra basic examples. Like… in the original I2C methods for the HTPB code, you have to initialize the HTPB, and send your commands in an array.
In the Driver, I don’t see where you initialized the HTPB, or anything about sending the commands in an array. So something explaining that would be nice.
Hey there Eric,
The HTPBsetupIO() call is used to configure the IO pins to be either inputs or outputs. 1 means output, 0 means input. The default state upon power up is input. In the HTPB-test1.c program there is a call to this function in line 41 (with a little comment above it). The samples I am working on now are a little more verbose with the comments.
The driver suite was written so you don’t need to worry about things like what kind of messages you need send to a sensor to make certain things happen. Rather, you just get an easy to use API that hides a lot of this stuff (like recovering from transmission errors, etc) from you without losing any functionality. Other tricky things like converting multiple unsigned bytes into signed or unsigned ints and longs is also handled for you.
There is an I2C tutorial on this site somewhere (can’t remember the URL off the top of my head), shouldn’t be too hard to find with the search box up in the top right of the site 🙂
Regards,
Xander
Thanks Xander,
I’ll hunt down that I2C tutorial… and that does help with the setup bits. I’m having fun learning anyhow. 🙂
I figured out how to lock up the NXT from within RobotC. 😛 I was doing some graphic programming, converted an Int to a Float, and it hoses the NXT until you pop a battery out.
Eric,
Mail me the piece of code that causes the crash and I’ll pass it on to the devs.
– Xander