Table of Contents Chapter Index Previous Slide Next Slide 361
Using a toggle switch

Writing program scripts with JavaScript
Using a toggle switch
  • Use the toggle switch to make a lamp turn on and off
  • Use a TouchSensor node to sense a switch shape

  • Route the sensor node's isActive eventOut into the script node's set_active eventIn

  • Route the script node's on_changed eventOut into the light node's set_on eventIn