– This header block indicates the program will be translated in to Arduino code and uploaded to the mCore board.
– The program waits for the time input
– The note selected is played on the on-board buzzer for the length selected.
– A forever loop – all the code inside the loop will run forever
– Sets the LEDs – can select the left LED, the right LED, or both LEDS and any value of red, green and blue between 0 and 255.
– Moves the mBot – options are forward, backward, left or right, speed between -255 and 255.
– Can control the motors individually setting either M1 or M2 to a power setting between -255 and 255.
– The Less-Than Operator. If the thing you put in the left hand side is less than the thing you put in the right hand side, this block will evaluate as true, otherwise it will be false.
– This returns the value of the ultrasonic sensor in centimetres. Possible values are between 3 and 400. You need to make sure the right port is selected.
– This returns the value of the light sensor. Possible values are between 0 and 1023 with 0 being dark and 1023 being light.
– If the condition in the top line is true, the code inside this block will be executed, otherwise it won’t.
– This will return a random number between the 2 numbers you enter.
– This will return true if the thing in the left AND the thing in the right both return true.
– This returns the value of the line follower sensor as follows: 0 – no light reflected, 1 – light reflected to right side, 2- light reflected to left side, 3 – light reflected to both sides. You need to make sure the right port is selected.
– Returns true or false. Correct port must be selected and then the side of the sensor and whether you are testing for black or white.
– This button creates a variable.
– This block returns the value of the variable.
– Sets the variable selected to the value input on the right.
– Adjusts the variable selected by the amount input on the right.
– resets the on-board timer to 0 (the timer immediately starts counting).
– Returns the value of the timer in seconds.
– Boolean block that has pressed or released as its options.
– Can only be used from the mBlock environment. Triggers the code below this block to be run when the on-board button is either pressed or released.
– Creates a block (function)
– calls a function, with the option of passing parameters.
– The header block for a block (function). Code attached to this header block will be run when the function is called.
– Returns the value of the parameter.
– sends a message out via infrared.
– returns any message the mBot has received via infrared.
– This block is used to verify whether the mBot has received data via serial communication.
– Used to check if two strings are equal. Usually used to check that a line read from the serial communication matches a certain string.
– Returns a line read from serial communication.
– Sends a line through serial communication.