|
1 | 1 | /*
|
2 |
| - * DSC Keypad Interface 1.1 (esp32) |
| 2 | + * DSC Keypad Interface 1.2 (esp32) |
3 | 3 | *
|
4 |
| - * Interfaces directly to a DSC PowerSeries keypad (without a DSC panel) to enable use of |
5 |
| - * DSC keypads as physical inputs for any general purpose. |
| 4 | + * Interfaces directly to a DSC PowerSeries or Classic series keypad (without a DSC panel) to |
| 5 | + * enable use of DSC keypads as physical inputs for any general purpose. |
6 | 6 | *
|
7 | 7 | * This interface uses a different wiring setup from the standard Keybus interface, adding
|
8 | 8 | * an NPN transistor on dscClockPin. The DSC keypads require a 12v DC power source, though
|
9 | 9 | * lower voltages down to 7v may work for key presses (the LEDs will be dim).
|
10 | 10 | *
|
11 |
| - * Supported features: |
| 11 | + * PowerSeries keypad features: |
12 | 12 | * - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key
|
13 | 13 | * - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Fire, Program, Backlight, Zones 1-8: dsc.lightReady, dsc.lightZone1, etc
|
14 | 14 | * - Set keypad beeps, 1-128: dsc.beep(3)
|
|
18 | 18 | * 3 beeps, constant tone, 2 second interval: dsc.tone(3, true, 2)
|
19 | 19 | * Disable the tone: dsc.tone() or dsc.tone(0, false, 0)
|
20 | 20 | *
|
| 21 | + * Classic keypad features: |
| 22 | + * - Read keypad key button presses, including fire/aux/panic alarm keys: dsc.key |
| 23 | + * - Set keypad lights: Ready, Armed, Trouble, Memory, Bypass, Zones 1-6: dsc.lightReady, dsc.lightZone1, etc |
| 24 | + * |
21 | 25 | * Release notes:
|
| 26 | + * 1.2 - Add Classic keypad support - PC1500RK |
22 | 27 | * 1.1 - Add keypad beep, buzzer, constant tone
|
23 | 28 | * 1.0 - Initial release
|
24 | 29 | *
|
|
53 | 58 | *
|
54 | 59 | * This example code is in the public domain.
|
55 | 60 | */
|
| 61 | + |
| 62 | +// Set the keypad type |
56 | 63 | #define dscKeypad
|
| 64 | +//#define dscClassicKeypad |
57 | 65 |
|
58 | 66 | #include <dscKeybusInterface.h>
|
59 | 67 |
|
|
62 | 70 | #define dscReadPin 19 // 4,13,16-39
|
63 | 71 | #define dscWritePin 21 // 4,13,16-33
|
64 | 72 |
|
65 |
| -dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin); |
66 |
| - |
67 | 73 | // Initialize components
|
| 74 | +#ifdef dscKeypad |
| 75 | +dscKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin); |
| 76 | +#else |
| 77 | +dscClassicKeypadInterface dsc(dscClockPin, dscReadPin, dscWritePin); |
| 78 | +#endif |
68 | 79 | bool lightOff, lightBlink, inputReceived;
|
69 | 80 | const byte inputLimit = 50;
|
70 | 81 | char input[inputLimit];
|
|
0 commit comments