Follow me

Exercise 1: Writing the basic Follow Me!

In this exercise, you will learn how to write a basic “follow me” light.

Question 1 – Tutorial: Follow the basic binary lights tutorial to implement your first follow me application with binary lights.

Use “LightFollowMe” as the name of your component and “LightFollowMeImpl” as your implementation class. The package will be “org.example.follow.me”

You can skip the “play with it section” if you would like to. Optionally you can also read the getting started section as recommended in the tutorial.

Question 2 – React when a light is moved: The current application does not manage the change of light location. Listen to the change of location and change each light state accordingly.

Question 3 – Scripts: You will now test that the application is working correctly. To do so, you will need to use a script.

About scripts

The iCASA environment can be created and modified using scripts. A script is an XML file with a specific extension (.bhv) that contains sequentially executed instructions. The list of available commands can be found in the iCASA scripts documentation.

To play a script, you need to deploy it in the iCASA load directory. Scripts can then be run using the “Script Player” panel, you then can select and start your script in the “Script” section. At any time, only one script can be played.

 

For beginning and to ease the process of creating scripts, we will provide you a skeleton script for testing your light application. You will need to enhance it to be able to test your applications.

Download and deploy the following script : single_bl_light_environment.bhv in the load directory of iCASA. The script should be now available in the “Script player” in the iCASA GUI.
Run the script and check that the application is working as expected.