You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/readme.md
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -102,35 +102,33 @@ Read the state of the pads and save them to be analyze in the different type of
102
102
Buttons.update()
103
103
```
104
104
105
-
### ButtonX class
106
-
107
-
Button0 - Button4
105
+
Use TOUCHX being X a number from 0 to 4 (Button00 - Button04)
108
106
109
107
Get if the pad is getting touched, true until it gets released
110
108
```cpp
111
-
ButtonX.getTouch()
109
+
Buttons.getTouch(TOUCHX)
112
110
```
113
111
114
112
Get when have been a touch down
115
113
```cpp
116
-
ButtonX.onTouchDown()
114
+
Buttons.onTouchDown(TOUCHX)
117
115
```
118
116
119
117
Get when the button has been released
120
118
```cpp
121
-
ButtonX.onTouchUp()
119
+
Buttons.onTouchUp(TOUCHX)
122
120
```
123
121
124
122
Get both, touched and released
125
123
```cpp
126
-
ButtonX.onTouchChange()
124
+
Buttons.onTouchChange(TOUCHX)
127
125
```
128
126
129
127
In case you have another enclosure you can change the sensitivity of the pads, 3-100
130
128
Automatically configured when you set the `CARRIER_CASE` boolean, by default is false (sensitivity threshold 4)
131
129
132
130
```cpp
133
-
ButtonX.updateConfig(int newSens)
131
+
Buttons.updateConfig(int newSens)
134
132
```
135
133
136
134
#### Syntax example
@@ -148,8 +146,8 @@ void loop(){
148
146
carrier.Buttons.update(); // Read the buttons state
149
147
150
148
//Check if the Button 0 is being touched
151
-
if (carrier.Button0.getTouch()){
152
-
Serial.println("Touching Button 1");
149
+
if (carrier.Buttons.getTouch(TOUCH0)){
150
+
Serial.println("Touching Button 0");
153
151
}
154
152
155
153
//You can replace getTouch(), with the other types of touch events
@@ -302,9 +300,12 @@ Colors : every color with the prefix ‘ST77XX_’ i.e. ST77XX_BLACK. Colors ava
302
300
303
301
In order to turn on the screen you will need to add this inside the setup()
304
302
(already inside the main begin())
303
+
304
+
```cpp
305
305
display.init(240, 240);
306
306
pinMode(TFT_BLACKLIGHT, OUTPUT);
307
307
digitalWrite(TFT_BLACKLIGHT,HIGH);
308
+
```
308
309
309
310
Colors : every color with the prefix ‘ST77XX_’ i.e. ST77XX_BLACK. Colors available from the library are BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, ORANGE
0 commit comments