Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For this exercise, we will create a button that gradually turns a lamp on when pressed, then off again when unpressed.

We will split this up into two parts:

  • First we will create a button that turns on/off Create a temporary push button (basic).

  • Next, we will use that Use the button to gradually control a lamp object (advanced).

Making a Temporary Push Button

A temporary push button is one that only emits a signal while it is pressed. When released, the signal turns off again.

...

Save the project and run the simulator. Pressing and releasing the button should change the Switch/Lamp image:

...

Changing a Value Gradually

Now, create another tag that will gradually change between 0.0 and 1.0:

...