Lights demo MWP


This script demonstrates how to use the overhead lights and the commands needed for the seven lights available - red, green, blue, yellow, cyan, magenta, white - in the MWP unit.

Top

Video illustrating the overhead light settings on the MWP.

Script explanation

Refer to this script when programming different colours for the overhead lights in the MWP unit.

First part and Action Main:

INCLUDE ZSYS
 
DEFINE NUM_TIMES 2
DEFINE WT 3 
 
ACTION MAIN 
 
 INVOKE(COLOURS,NUM_TIMES)
 
COMPLETE

Action Colours

This is split up into sections to illustrate the code for each colour:

ACTION COLOURS 
 
#RED
 SET(GPO6,1) #RED LED 
 SET(GPO7,0) #GREEN LED 
 SET(GPO8,0) #BLUE LED 
 WAIT(WT) 
 
#GREEN
 SET(GPO6,0)
 SET(GPO7,1)
 SET(GPO8,0)
 WAIT(WT)
 
#BLUE
 SET(GPO6,0)
 SET(GPO7,0)
 SET(GPO8,1)
 WAIT(WT)
 
#YELLOW
 SET(GPO6,1) 
 SET(GPO7,1) 
 SET(GPO8,0) 
 WAIT(WT) 
 
#MAGENTA
 SET(GPO6,1)
 SET(GPO7,0)
 SET(GPO8,1) 
 WAIT(WT)
 
#CYAN
 SET(GPO6,0)
 SET(GPO7,1)
 SET(GPO8,1) 
 WAIT(WT) 
 
#WHITE 
 SET(GPO6,1) 
 SET(GPO7,1) 
 SET(GPO8,1) 
 WAIT(WT) 
 
#OFF 
 SET(GPO6,0)
 SET(GPO7,0)
 SET(GPO8,0) 
 WAIT(WT) 
 
COMPLETE

In the commands above you can see:

  • The command SET(GP06,1) turns the red overhead LED on, and SET(GP06,0) turns the red overhead LED on.
  • The SET commands work similarly for the colours green (GP07) and blue (GP08).
  • Please note that the unit will not read any line of code after #.
Top

Script download

Here you can download the lights demo script for the MWP unit as a .zs file. Right click on the download link below and download / save the file as a zanscript file, i.e. in the same format: lights_demo_mwp.zs.

Script download: lights_demo_mwp.zs