summaryrefslogtreecommitdiff
path: root/wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs2
diff options
context:
space:
mode:
Diffstat (limited to 'wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs2')
-rw-r--r--wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs250
1 files changed, 0 insertions, 50 deletions
diff --git a/wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs2 b/wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs2
deleted file mode 100644
index 259c5025..00000000
--- a/wpd/WpdBasicHardwareDriver/firmware/pir_wpd_enabled.bs2
+++ /dev/null
@@ -1,50 +0,0 @@
-' Pir_wpd_enabled.bs2
-'
-' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-' PARTICULAR PURPOSE.
-'
-' Copyright (c) Microsoft Corporation. All rights reserved
-'
-' {$STAMP BS2}
-' {$PBASIC 2.5}
-' =========================================================================
-
-SensorID VAR Byte 'Sensor identifier = 5 for PIR
-ElementSize VAR Byte 'Size (in bytes) of each element
-ElementCount VAR Byte 'Count of elements in packet
-bMotion VAR Byte 'Motion-detection variable (single element for PIR)
-Padding VAR Byte 'Padding for the 8-byte element
-
-SensorID = 5
-ElementSize = 1
-ElementCount = 1 '1-byte for motion data; 5 for interval
-
-NewInterval VAR Word 'New interval requested by user
-Interval VAR Word 'Interval value utlized by firmware
-
-LFD CON $10 'Linefeed character
-
-Interval = 500 '.500 of a second interval
-NewInterval = 500
-
-Main:
-
- GOSUB PollSensor 'Was motion detected?
- GOSUB RetrieveInterval 'Retrieve units data
-
-Timeout:
- SEROUT 16, 16468, [DEC1 SensorID, DEC1 ElementSize, DEC1 ElementCount, DEC1 bMotion, DEC5 Interval,LFD]
- GOTO Main
-
-PollSensor:
- bMotion = IN0 ' Assign status of P0 to bMotion
- RETURN
-
-RetrieveInterval:
- SERIN 16, 16468, Interval, Timeout, [DEC NewInterval] 'Retrieve interval
- IF NewInterval >= 10 AND NewInterval <= 60000 THEN
- Interval = NewInterval
- ENDIF
- RETURN \ No newline at end of file