EasyManuals Logo

LEGO MINDSTORMS Robots User Manual

LEGO MINDSTORMS Robots
226 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
Page 73
start taskname
This command starts the named task.
stop taskname
Use this command to stop the named task.
The following program controls its outputs from main and uses another task, sing, to play some music. The sing task has to be started from main; otherwise, its commands will never be
executed.
task main() {
start sing;
while (true) {
OnFwd(OUT_A);
OnRev(OUT_C);
Wait(100);
OnFwd(OUT_C);
OnRev(OUT_A);
Wait(100);
}
}
#define SIXTH 12
#define HALF 3SIXTH
#define BEAT 2HALF
#define GRACE 6
task sing() {
PlayTone(330, 2BEAT);
Wait(2BEAT + 2SIXTH);
PlayTone(115, SIXTH);
PlayTone(208, SIXTH);
PlayTone(247, SIXTH);
PlayTone(330, SIXTH);
PlayTone(311, 2BEAT);
Wait(4SIXTH + 2BEAT + 2SIXTH);
PlayTone(115, SIXTH);
PlayTone(208, SIXTH);
PlayTone(247, SIXTH);
PlayTone(311, SIXTH);
PlayTone(277, 3BEAT);
Wait(4SIXTH + 3BEAT + HALF);
PlayTone(277, HALF);
PlayTone(311, HALF);
PlayTone(370, GRACE);
PlayTone(330, HALF);
PlayTone(311, HALF); Wait (2HALF);
PlayTone(277, HALF);
PlayTone(330, HALF);
PlayTone(220, HALF);
PlayTone(220, 2BEAT);
Wait(GRACE + 5HALF + 2BEAT + HALF);
PlayTone(247, HALF);

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the LEGO MINDSTORMS Robots and is the answer not in the manual?

LEGO MINDSTORMS Robots Specifications

General IconGeneral
Product LineLEGO MINDSTORMS
CategoryToy
Age Range10+
Batteries RequiredYes
Memory64 MB RAM, 16 MB Flash
ConnectivityBluetooth, USB
SensorsTouch, Color, Gyro
Battery TypeAA
Interactive FeaturesProgrammable, Remote Control
App CompatibilityiOS, Android
ProcessorARM9
Pieces Count601
Battery Count6
App NameLEGO MINDSTORMS EV3 Programmer App

Related product manuals