Skip to content

Commit

Permalink
Increased button sensitivity using floor()
Browse files Browse the repository at this point in the history
  • Loading branch information
Coder-X15 authored Jun 7, 2023
1 parent 989c642 commit 6ddf249
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion src/constants.h
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@

#ifndef constants_h
#define constants_h
#define BT_UP 0
#define BT_DOWN 1
#define BT_LEFT 2
#define BT_RIGHT 3
#define BT_SELECT 4
#define BT_TEMP 5
#define RS 8
#define EN 9
#define D4 4
#define D5 5
#define D6 6
#define D7 7
#define UP 1
#define DOWN 3
#define LEFT 5
#define RIGHT 0
#define SELECT 7
#define ANALOG 6
#define DIGITAL 14
#endif
2 changes: 1 addition & 1 deletion src/std_subroutines.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ButtonRead_Subroutine : public Subroutine
int priotrity = 0;
void run()
{
int temp = analog_pinset.read_from_pin(A0);
int temp = floor(analog_pinset.read_from_pin(A0)/100);
button_value = temp;
}

Expand Down

0 comments on commit 6ddf249

Please sign in to comment.