Coding Edbot Dream with Scratch
What’s inside an Edbot Dream? Microcontroller Optional Optional Included Optional Battery
The microcontroller The heart of the Edbot Dream. 4 ports to connect to external equipment. Battery connector. Socket for a Bluetooth module. 4 built in sensors. 3 IR sensors & clap counter. Internal buzzer. Battery connector
Motors & Servos You get 2 motors Connect to port 1 or 2 with a 2-wire cable. You can control motor speed & direction. … and 1 servo Connect to port 3 or 4 with a 5-wire cable. Can operate in: Wheel mode (like a motor). Joint mode (set it to a position).
Edbot Software Edbot Software enables your Scratch program to control your Edbot Dream robots. Edbot Dream Scratch blocks are found in the ‘More blocks’ section. Use them like any other Scratch blocks to build your program.
Controlling a motor Control the speed & direction of a motor. Speed is entered as a percentage (with 100 as the maximum). To stop a motor set its speed to zero. Direction is clockwise or anticlockwise. Can also control servos in wheel mode.
Controlling a servo Turn a servo on or off. Set the position and speed of a servo. Servo turns on and moves to position. Position is an angle between 0-300 degrees (see diagram). Speed controls how quickly the servo moves to its position. Entered as a percentage (maximum is 100).
Motors – Multi Blocks Control motors or servos in wheel mode at the same time. Set motor speeds Enter port number followed by “/” followed by speed (as a percentage). A negative speed will rotate clockwise, a positive speed will rotate anti- clockwise. To stop a motor set its speed to zero. Set multiple motors by repeating the sequence e.g. 1/50/2/50/3/-50.
Servos – Multi Blocks Control a number of servos at the same time. Turn servos on or off. Enter port number (3 or 4) followed by “/” followed by a 0 or 1 to turn servo off or on. Set servo positions. Set speed and position of a set of servos connected to ports 3 & 4. Enter port number followed by “/” followed by the position as an angle between 0-300 degrees, followed by “/” followed by the speed as a percentage e.g. 3/150/50. Set multiple servos by repeating the sequence e.g. 3/150/50/4/150/100.
Buzzer Blocks Control the microcontroller’s built-in buzzer. Buzzer pitch Use this block to play a note with the built-in buzzer. Specify pitch from 0 to 48. Specify duration in units of 1/10 of a second (a duration of 10 would be 1 second). Buzzer melody This block plays a pre-programmed ‘tune’. Choose a number from 0 to 24.
Speech Blocks Get your Edbot Dream to speak! Say the words. Say the words and wait for the speech to finish before continuing. Current word (a reporter block). Gives you the current word as it is being spoken. Returns empty text (zero length) if Edbot Dream isn’t speaking.
Sensor Blocks – Reporters (1) Port sensor. This reporter block gives the value of an external sensor connected to port 3 or 4. e.g. the servo position in degrees (0-300). Clap count. A reporter block that detects the number of claps (loud noises) that have occurred in the last few seconds. When clapping stops, the live count is transferred to last count and live count is set to 0.
Sensor Blocks – Reporters (2) Built-in IR sensors. Uses infra-red to measure distance to an object. Reading is approximate distance in cm (range 3cm to 20cm). Different coloured objects may give different readings. You can also use the raw value returned.
Other Blocks Use this block to reset the microcontroller. Servos & motors will stop. Clap counter is reset to zero. Speech is halted.