Scribbler 2

Materials to Support a C-based Course with Scribbler 2 Robots
Scribbler 2

MyroC: User Troubleshooting Guide

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.


Compiling with make Scribbler robots Running programs

Compiling with make

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'
 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)

Scribbler 2 Robots

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'
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

Running Compiled Programs

Error Message(s), if any Possible Corrective Action Problem Summary
MathLAN runtime error:
error while loading shared shared libraries: cannot open share object file: No such file or directory
  • Use editor (e.g., emacs) to update the .bashrc file:
    emacs ~/.bashrc &
  • Insert the following lines at the end of the .bashrc file
     #make the MyroC libraries known to the execution environment
     export LD_LIBRARY_PATH
  • Tell the current terminal window about the revised .bashrc file
     source ~/.bashrc
MyroC program does not run on MathLAN
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
  • pitch of notes may be too low for tone generator
    use higher pitches (e.g., double all frequencies)
  • robot may be in "mute" mode
    issue command rSetVolume ('H') to reset to "high" volume
    ( rSetVolume ('M') changes robot to "mute" mode)
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()
  • check the direction of the robot by calling rGetForwardness(), which with return either "fluke-forward" or "scribbler-forward"
  • change the direction of the robot by calling rSetForwardness, correspondingly.
Scribbler robot is set to fluke forward instead of scribbler forward, or vice versa, depending on the results you are expecting
program hangs with no output or warning (Mac OS X) Recreate a Bluetooth pairing
  • Under the Bluetooth icon (top of screen), choose "Open Bluetooth Preferences"
  • Highlight robot device with given serial number, and click on the "X"
  • With robot turned on, find the robot serial number in the display, and click on "pair"
  • If pairing fails, click on box and use passcode 1234
On Mac OS X, programs consistently hang at rConnect
cannot find file or directory
  • Check the path name is correct for the desired picture
  • Check the desired image is in the specified directory
error reported for rLoadPicture