Touch Sensors Module Pseudocode - Notepad
Touch Sensors Module Pseudocode - Notepad
/*
This module handles initializing the touch sensor pins as digital inputs and
contains the 3 event checkers for each touch sensor
*/
CheckTouchSensor1Press:
read current touch sensor value of RA2
if CurrentSensorState is different from LastTouchStatefor sensor 1 and the
CurrentSensorState is 1:
creae new TOUCH_SENSOR_PRESS event
set EventParam to 1 // to indicate which touch sensor was pressed
post event to GameProgressionService
CheckTouchSensor2Press:
read current touch sensor value of RA3
if CurrentSensorState is different from LastTouchStatefor sensor 2 and the
CurrentSensorState is 1:
creae new TOUCH_SENSOR_PRESS event
set EventParam to 2 // to indicate which touch sensor was pressed
post event to GameProgressionService
CheckTouchSensor3Press:
read current touch sensor value of RA4
if CurrentSensorState is different from LastTouchStatefor sensor 3 and the
CurrentSensorState is 1:
creae new TOUCH_SENSOR_PRESS event
set EventParam to 3 // to indicate which touch sensor was pressed
post event to GameProgressionService