Light Sensors Module Pseudocode - Notepad
Light Sensors Module Pseudocode - Notepad
/*
This module handles initializing the light sensor pins as digital inputs and
contains the 3 event checkers for each light sensor.
*/
CheckLightSensor1Activated:
read current touch sensor value of RB11
if CurrentSensorState is different from LastLightState for sensor 1 and the
CurrentSensorState is 0:
creae new LIGHT_SENSOR_ACTIVATED event
set EventParam to 1 // to indicate which light sensor was activated
post event to GameProgressionService
CheckLightSensor2Activated:
read current touch sensor value of RB12
if CurrentSensorState is different from LastLightState for sensor 2 and the
CurrentSensorState is 0:
creae new LIGHT_SENSOR_ACTIVATED event
set EventParam to 2 // to indicate which light sensor was activated
post event to GameProgressionService
CheckLightSensor3Activated:
read current touch sensor value of RB13
if CurrentSensorState is different from LastLightState for sensor 3 and the
CurrentSensorState is 0:
creae new LIGHT_SENSOR_ACTIVATED event
set EventParam to 3 // to indicate which light sensor was activated
post event to GameProgressionService