building the body - programming - components - our progress - resources - home

 

programming

A majority of our set backs occurred when the handyboard or other components "inexplicably" stopped functioning. I've know that when computer hardware stops functioning or malfunctions, there is always a reason. However there are so many variables with the handyboard, most of which I know nothing about; when problems occurred, I seldom knew where to begin on how to solve them. Surfing the net for hours might yield a solution, more likely, however, you'll find 100's of fixes to problems that are not yours. You can post questions to this newsgroup. In general, when the board doesn't respond; don't assuming that anything is correct - check everything. You can check IC configuration with "ic -config". Make sure your serial port and code directory are set correctly. (I spent a week trying to get a board to communicate with my computer via Com1 when I finally check this configuration, I found that, even though I'd been sending code via COM1 all semester, IC was trying to use Com2. Why? I'm not sure, but check all of your settings. Of course, if you only have one serial port, this is not a problem.)

If you are able to establish a connection with the board, but the code does not load (for reasons OTHER then a compiler error, re-download the "pcode_hb.s19" file. This is basically a driver that allows you to run the IC-mini operating system. (yep, IC is little operating system and like windows and bit of "reformat, reinstall" is a good idea.) Reloading the Pcode will clear all of your buffers and repair any changes that your program accidentally when it crashed or failed to load successfully.

Another bit of "weirdness" occurs if you are working on a fast pentium. (My 500 choked IC all of time) You can open a DOS window to edit your code and run other programs (DOS window, WinAMP, Telnet, Photoshop, Dreamweaver, Netscape, AIM, ICQ, no problem) However, when you are loading code, multitasking is bad idea. Symptoms vary, but in general, IC just won't function well. To circumvent this, just maximize the DOS window (Alt-Enter).

Much of the code I've found on the web uses the very standard constant-declaration "#DEFINE" and the type-def "double". However, the version of IC that we are using does not recognize these words. I'm not really sure why, but i think it may be because we are using a shareware version of IC. The official 3.2 IC is here. (requires registration $$$). Or you can just work around these compiler errors. Use "float" instead of "double" and treat your constants as variables... not a great programming practice, but it works!

Shana's page details loading IC and the handyboard reference cover the specifics of of coding. For someone with some programming experience, the coding is fairly straightforward.

I've included a few simple test routines for testing motors and calibrating sensors as well as the range sensor tester, the circular-track following code and the maze code. (Shana has some code here)

Hello, World!
motor-touch sensor interaction
Analog sensor watcher track program
IR sensor watcher maze program (white line following)