diff options
| author | J M Rossy <[email protected]> | 2015-07-29 15:40:09 -0700 |
|---|---|---|
| committer | J M Rossy <[email protected]> | 2015-07-29 16:34:40 -0700 |
| commit | 5d61a4a79a1e96dc5d9af1e5e712c84507307544 (patch) | |
| tree | 49ed270893578cd18758b74ffcca16dc7ab948d6 /wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2 | |
| parent | 5d41613e26e147d2300c786bb2b34cb4b4067a25 (diff) | |
Samples update for public Windows 10 release
Fix #2 Enabling WPP Recorder in Sensors Samples causes errors
Fix #4 Add back fixed KMDOD sample
Add new BarcodeScanner sample in pos folder
Add new MagneticStripeReader sample in pos folder
Add new SynpaticsTouch sample in input folder
Add new Power Engine Plugin sample in pofx folder
Add new DeviceMft sample in avstream folder
Add new AvsCamera sample in root
Add new SimBatt sample in root
Add other pre-existing samples not yet released for Win10
Diffstat (limited to 'wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2')
| -rw-r--r-- | wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2 b/wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2 new file mode 100644 index 00000000..ff5a7b55 --- /dev/null +++ b/wpd/WpdBasicHardwareDriver/firmware/piezo_wpd_enabled.bs2 @@ -0,0 +1,55 @@ +' Piezo_wpd_enabled.bs2 +' +' This program demonstrates using the LDT0 as a switch/trigger +' +' 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 = 8 for piezo +ElementSize VAR Byte 'Size (in bytes) of each element +ElementCount VAR Byte 'Count of elements in packet +bVibration VAR Byte 'Vibration-detection variable (single element for PIR) +Padding VAR Byte 'Padding for the 8-byte element + +SensorID = 8 +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 + +Interval = 500 +NewInterval = 500 + +LFD CON $10 'Linefeed character + + +' -----[ Program Code ]---------------------------------------------------- + +Main: + + GOSUB PollSensor 'Was motion detected? + GOSUB RetrieveInterval 'Retrieve units data + +Timeout: + SEROUT 16, 16468, [DEC1 SensorID, DEC1 ElementSize, DEC1 ElementCount, DEC1 bVibration, DEC5 Interval, LFD] + GOTO Main + +PollSensor: + bVibration = 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 |
