-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathkeycheck.h
40 lines (26 loc) · 914 Bytes
/
keycheck.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**************************************************************************/
/*!
@file keycheck.h
@author lisper ([email protected])
@license LGPLv3 (see license.txt)
key check for Arduino
Copyright (C) DFRobot - www.dfrobot.com
function: ispressed (uint16_t key, uint16_t state);
-> for digital pin
issticked (uint16_t key, uint16_t value);
-> for analog pin
issticked2 (uint16_t key, uint16_t left, uint16_t right);
-> for analog pin
*/
/**************************************************************************/
#ifdef __KEYCHECK__
#define __KEYCHECK__
uint16_t key_analog_range = 50;
uint16_t key_delay_time = 20;
//digital pin key 0 or 1
boolean ispressed (uint16_t key, uint16_t state);
//analog pin key
boolean issticked (uint16_t key, uint16_t range);
//analog pin key
boolean issticked2 (uint16_t key, uint16_t left, uint16_t right);
#endif