// Playing a sound file task main() { // blah blah blah playSoundFile("Confirm"); // blah blah blah playSoundFile("Oops"); }The robot has built in sound files that can be heard when you play them using the playSoundfile() function. Just put the name of the sound file in double-quotes. Below are just some of the sound files that are in the robot and can be played. Note that spelling and capitalization are important. If you misspell the name of the sound file, the robot will not play it.
// Show different colors of the LED task main() { // blah blah blah setLEDColor(ledRed); sleep(1000); // blah blah blah setLEDColor(ledGreenFlash); sleep(1000); // blah blah blah setLEDColor(ledOrangeBlink); sleep(1000); // blah blah blah setLEDColor(ledOff); }In the above example you may have noticed the sleep() function was included after the setLEDColor() function. This was done so that the color would be displayed for 1 second (or 1000 milliseconds). You can change the number if you want it displayed for a longer or shorter period of time.
// Show some messages on the LCD screen task main() { // blah blah blah displayBigTextLine(1, "Hello World"); displayBigTextLine(3, "I am alive"); // blah blah blah displayBigTextLine(5, "Houston,"); displayBigTextLine(7, "We have a"); displayBigTextLine(9, " problem..."); }Note that the LCD panel is not very big. You probably can only write about 20 letters on any one line. Don't write a book in your debug messages to the LCD screen.
// Write a message to the debugWriteStream() task main() { writeDebugStreamLine("\n=================\n"); writeDebugStreamLine("Starting the program\n"); // blah blah blah writeDebugStreamLine("\n=================\n"); writeDebugStreamLine("I am in followLine()\n"); // the "\n" characters used above will insert a new line // blah blah blah }To view the debugWriteStream(), open the debugger windows menu item in the "robot" menu of the RobotC IDE.
// Load the Speech Engine #include "SpeechEngine.c"; task main() { // blah blah blah say("Starting the program"); // blah blah blah say("I am in follow line"); }