![]() |
MyroC
Materials to Support a C-based Course with
Scribbler 2 Robots
|
![]() |
|
This Guide builds on insights of the testing/development group for MyroC.3.0, as they remembered common experiences taking CSC 161 and they worked through a wide range of tests and examples using the new infrastructure.
Sections
| Compiling with make | Scribbler robots | Running programs |
| Error Message(s), if any | Possible Corrective Action | Problem Summary |
|---|---|---|
make: Nothing to be done for 'beep-move-demo.c.'
| When using make, be sure to call the function name
without .c | example: make beep-move-demo instead of make beep-move-demo.c using make with a .c file
| |
| fatal error: MyroC.h: No such file or directory #include "MyroC.h" | no Makefile in program directory.
| Missing MyroC file |
| warning: implicit declaration of function rConnect
[-Wimplicit-function-declaration] rConnect("/dev/rfcomm0"); /* connect to robot */ | Check program contains library reference: #include "MyroC.h" | Missing rConnect declaration |
warning: implicit conversion from 'double' to 'int'
[-Wliteral-conversion]
int left = 0.33;
~~~~ ^~~~
| changes value from 0.33 to 0 make sure data types match in variable declaration and assignment | calling a double when the variable is an int |
| errors in parameters involving strings: error: expected expression" "use of undeclared variable" | Check for char * variable or double quotes when string is required (e.g., rLoadPicture, rSetForwardness) |
| Error Message(s), if any | Possible Corrective Action | Problem Summary |
|---|---|---|
| Batteries drop out | Insert batters and use masking tape to attach cover | Battery cover does not latch |
| warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [Wint-conversion] char * name = 'ffff'; | Use double quotes for all literal strings, such as
when initializing a string variable char name = "literal string"; Using single quotes when initializing a string
(char *) variable
| |
| Error Message(s), if any | Possible Corrective Action | Problem Summary |
|---|---|---|
|
MathLAN runtime error: error while loading shared shared libraries: libMyroC.so.3.0: cannot open share object file: No such file or directory |
| |
| program that ran before no longer functions properly | Change batteries | Robot behavior seems flaky |
| m??? or other short string of apparently random characters early in program execution | Check for a call to rConnect before calling any other function that uses a Scribbler robot | no rConnect |
| no sound |
| Robot pauses for rBeep commands, but no sound is audible |
| [Obstacle] sensors are not finding obstacles | Make sure that the obstacle is at a moderate distance (not too far, not too close), so that the reflected light can reach the sensors | obstacle too near or too far away |
| every movement function seems to be reversed; for example, rForward() is behaving like rBackward(), rTurnLeft() like rTurnRight() |
| |
| program hangs with no output or warning (Mac OS X) | Recreate a Bluetooth pairing
| On Mac OS X, programs consistently hang at rConnect |
| cannot find file or directory |
| error reported for rLoadPicture |
| On recent Mac OS X machines images do not appear |
| Type the following line in the terminal window:
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES |