Loading...

bob3.setLed()

In this example we're going to get to know the following method better:

bob3.setLed(id, color);

Up until now, we've used the method, for example, to turn eye 1 on in white:

bob3.setLed(EYE_1, WHITE);

Now, we will take a closer look!

In the blue sidebar on the left you can find all the different methods available to your BOB3.

Try it out with the method bob3.setLed(id, color);

The method
bob3.setLed(id, color);
has two parameters: id and color

In place of the id you can use one of the four constants
EYE_1, EYE_2, LED_3 or LED_4
or the LEDs number,
i.e. 1, 2, 3 or 4.

For color you can use a color constant, e.g.
WHITE or a hexadecimal color value, e.g. 0xD13.

Compile the program and test it on your BOB3.

What does the programme do?

bob3.setLed(3, WHITE);

Recompile the program and test it on your BOB3.
Compile your new program and test it on your BOB3.
1: LED number one represents eye 1
2: Does is make a difference if you type bob3.setLed(EYE_1, WHITE); or bob3.setLed(1, WHITE);?
 You haven’t completed anything yet!
 Super, so far so good…
 Super, you got it all right!
 Sadly not correct…
 One answer is correct
 A couple are correct…