I’m trying to get a gyro sensor to output to a motor controlled by a joystick, by setting the joystick port to the sensor. I’m getting a basic init error when I try to do this. Anybody got any clues why?
Basic Inits usually occur when your constants (c_p1_x, c_sensor1, etc) don’t match your SERIN. If you drop your code in RoboEmu, it can usually detect these errors for you. Otherwise, feel free to post code here and I’d be happy to take a look at it.
–Rob
Yeah, we’ve had two instances where our other programmer changed the serin command without remembering to change the initialization constants to match, and couldn’t figure out what was causing the error.
He, unlike me, actually knows BASIC, but I, unlike him, have studied the specifics of PBASIC and the robot controller fairly closely, so we have to work together on this stuff.
As long as no changes have been made to the 'PBASIC - MASTER uP INITIALIZATION ROUTINE, the section right before the main do loop starts, then you have a problem with your serin command and or your 'DEFINE CONSTANTS FOR INITIALIZATION section. Look at those 2 sections and assure that for every constant set to 1, there is a corresponding variable in the correct order in the serin command.
I’ve found if I leave debug statements in my code, upload the program, and unhook the serial cable it gives me a Basic Init Error. This never happened in previous years though.
Check your program for any debug statements and try commenting them out.
The new PBASIC 2.5 allows for two-way debugging… i.e. the computer can send stuff back to the stamp.