Skip to content
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
e18126e
v0.1
edumeneses Nov 16, 2023
7b9d0d6
version 0.1
edumeneses Nov 16, 2023
cee2fa0
adding main thread, organizing folders, removing build
edumeneses Nov 24, 2023
5f77545
Organizing folders, adding main thread
edumeneses Nov 24, 2023
dbcb6ac
improve standalone
edumeneses Mar 8, 2024
b8409d6
init brnach, start refactoring
edumeneses Mar 9, 2024
a9f9e29
update
edumeneses Mar 9, 2024
9eaa28a
v0.1
edumeneses Nov 16, 2023
89147ca
version 0.1
edumeneses Nov 16, 2023
611f331
adding main thread, organizing folders, removing build
edumeneses Nov 24, 2023
be4484e
Organizing folders, adding main thread
edumeneses Nov 24, 2023
4111f94
improve standalone
edumeneses Mar 8, 2024
7d130ed
init brnach, start refactoring
edumeneses Mar 9, 2024
58c1c56
update
edumeneses Mar 9, 2024
cbe4a0c
rebase with main
edumeneses Mar 9, 2024
e1bb2e8
update
edumeneses Mar 10, 2024
8939552
update
edumeneses Mar 10, 2024
b15f375
organize structure and move submodule
edumeneses Mar 10, 2024
61c39f4
organize structure and move submodule
edumeneses Mar 10, 2024
e87db49
create refactor shake and starting on jab
edumeneses Mar 12, 2024
ff25c9e
added Shake 2D
edumeneses Mar 18, 2024
cd17814
finish shake
edumeneses Mar 21, 2024
a41a7c6
add boost circular buffer to utils and shake, finish jab
edumeneses Mar 21, 2024
6e3a480
add .vscode to gitignore
edumeneses Mar 21, 2024
5384d5b
added conversion units, finish jab
edumeneses Mar 21, 2024
06dd78f
started standalone app
edumeneses Mar 24, 2024
8c54c85
started standalone app
edumeneses Mar 24, 2024
2cf9fc1
remo.vscode
edumeneses Mar 24, 2024
9c7fe0c
standalone: creating nodes to test gestures
edumeneses Apr 4, 2024
5000a97
fix ossia handling
edumeneses Apr 24, 2024
c5e5e0e
update cmake and finish preliminary standalone
edumeneses Jun 13, 2024
6ec2f6c
define puara-jab functions in header file
rochanaf Jul 4, 2024
8629f7d
define puara-shake functions in header file
rochanaf Jul 4, 2024
145a902
define puara-utils functions in header file
rochanaf Jul 4, 2024
81df9ce
Merge pull request #7 from rochanaf/ref/use-header-files
edumeneses Jul 10, 2024
4da0e57
update leak integrator
edumeneses Jul 11, 2024
4791511
fix old value
rochanaf Jul 13, 2024
7ac769f
assign old value
rochanaf Jul 23, 2024
dadd9b8
Merge pull request #9 from rochanaf/refactor
edumeneses Jul 30, 2024
12e6190
roll_tilt using accelerometer data; both "unwrap" and "unfold"
mneedham01 Jul 31, 2024
7f3dfcc
initial commit
mneedham01 Aug 6, 2024
3a22341
added testing files
mneedham01 Aug 6, 2024
e350e3e
changed path to find testing data
mneedham01 Aug 6, 2024
505a23a
deleted changes to mag.x
mneedham01 Aug 6, 2024
7a3e898
added new testing files
mneedham01 Aug 7, 2024
45b62ab
read in new testing files
mneedham01 Aug 7, 2024
5721fa2
upload new testing files with timestamp; read in files
mneedham01 Aug 7, 2024
fe35d28
new files with non-drifting tstick data
mneedham01 Aug 7, 2024
557c3ac
added drifting data back in
mneedham01 Aug 7, 2024
7056c2a
added back in structs and utils
mneedham01 Aug 7, 2024
f5e9c2e
added new files, reorganized
mneedham01 Aug 7, 2024
5bb2581
new files + print statements
mneedham01 Aug 8, 2024
341166c
deleted roll testing files; moved smooth and wrap to utils; finalized…
mneedham01 Aug 8, 2024
22e0ea7
added roll_tilt
mneedham01 Aug 8, 2024
1548c66
tilt with testing functions, test files
mneedham01 Aug 8, 2024
6578f38
overloaded wrap and unwrap to be able to set max and min
mneedham01 Aug 8, 2024
d0de4e2
deleted testing framework
mneedham01 Aug 8, 2024
420bd1a
cleaned up documentation, formatting
mneedham01 Aug 9, 2024
1b2b0d7
improved logic + formatting of unwrap and smooth
mneedham01 Aug 12, 2024
39a4fc0
Final version roll and tilt with testing files
mneedham01 Aug 13, 2024
9a8f34c
review changes
mneedham01 Aug 13, 2024
3411a84
Mark header functions as inline
jcelerier Aug 13, 2024
0ae4f71
add calibration class
rochanaf Sep 12, 2024
bb42407
fix matrices bugs
rochanaf Sep 25, 2024
b5445a1
add documentation
rochanaf Oct 1, 2024
38081be
add coordinate conversion functions
rochanaf Oct 1, 2024
a3831bd
fix recordRawMagData doc
rochanaf Oct 1, 2024
4df84ff
Merge branch 'refactor' into testing-roll
edumeneses Oct 3, 2024
3ea23d3
Merge pull request #11 from mneedham01/testing-roll
edumeneses Oct 3, 2024
8f8ffa1
change standalone
rochanaf Oct 4, 2024
c98f7e8
fix conflicts
rochanaf Oct 4, 2024
abc1b93
resolve conflicts
rochanaf Oct 4, 2024
0b35841
Merge pull request #12 from rochanaf/feat/add-calibration
edumeneses Oct 4, 2024
1a41f84
Refactor: fix build issues
samamou Oct 10, 2024
ada14b8
formatting with clang
samamou Oct 11, 2024
78662ad
Added new headers for touch and button
samamou Oct 11, 2024
fb0b0d3
added missing files
samamou Oct 11, 2024
be34c16
Fix -1 values
samamou Oct 16, 2024
9b97ffc
intialize values
samamou Oct 16, 2024
409c54c
remove multiple declaration
samamou Oct 17, 2024
0b7dc1c
descriptos: fix minor C++ issues in jab, add missing inline to puara-…
jcelerier Oct 27, 2024
fa7a8fa
utils: refactor utils in separate files especially to split calibrati…
jcelerier Oct 27, 2024
e270070
descriptors: refactor a bit more, improve C++ style and remove unneed…
jcelerier Oct 27, 2024
2d15d7d
code: refactor further more, use standard C++ project organisation, a…
jcelerier Oct 27, 2024
a8f13cd
ci: add github actions build
jcelerier Oct 27, 2024
e84a09b
Add .gitignore
samamou Nov 5, 2024
9bdde0e
[tests] Update standalone to work with the refactor
jcelerier Nov 5, 2024
7f17b09
[cmake] Do not find boost if we already have it due to add_subdirecto…
jcelerier Nov 10, 2024
cb2e5ee
Merge branch 'development' into refactor/split_utils
edumeneses Nov 11, 2024
1a53061
[ci] Do not build standalone on CI due to dependency woes
jcelerier Nov 12, 2024
96f09c8
refactor leakyintegrator and small fixes
samamou Nov 14, 2024
dbe52e6
Add initial testing for touch gesture
samamou Nov 14, 2024
8d36a4e
fix broken build :/
samamou Nov 15, 2024
33441a5
Merge pull request #17 from Puara/refactor/split_utils
edumeneses Nov 15, 2024
9d31909
apparently wrap needs a non-default constructor
vberthiaume Dec 12, 2024
77ab3e4
starting the refactor
vberthiaume Dec 13, 2024
2d13db4
Substantial refactor.
vberthiaume Dec 16, 2024
f337d01
rename the file, do more exhaustive tests, all seem good
vberthiaume Dec 16, 2024
7cdc6c8
fix missing initialization bug. Add documentation
vberthiaume Dec 17, 2024
3def1e1
cleanup and add moved touch test
vberthiaume Dec 17, 2024
73c095f
rename blobDetector
vberthiaume Dec 17, 2024
d0d6a78
remove library.json for now
vberthiaume Dec 17, 2024
4084901
prComments
vberthiaume Dec 17, 2024
428dac6
prComments
vberthiaume Dec 17, 2024
12a02fa
remove extra file
vberthiaume Dec 17, 2024
695be19
add library.json to .gitignore
vberthiaume Dec 17, 2024
d0677fe
remove extraneous wrap constructor
vberthiaume Dec 19, 2024
5c0cdbf
Merge pull request #20 from Puara/refactor/18-blobDetection1D
edumeneses Dec 19, 2024
f19ab5f
Add Touch Example Project for Puara Gestures (#24)
vberthiaume Dec 24, 2024
8187089
Update Readmes and use included 3rdparty/boost in cmake
vberthiaume Jan 14, 2025
d708c6a
Merge pull request #27 from Puara/updateReadmes
edumeneses Jan 14, 2025
24f67c0
Refactor Touch class to extract Brush and Rub classes as their own to…
vberthiaume Feb 17, 2025
529d707
clean older files
edumeneses Feb 17, 2025
e4b1ff9
clean old files from CmakeLists
edumeneses Feb 17, 2025
eeac2fb
update blutton class to match the standard puara-gestures API
edumeneses Feb 20, 2025
61dd5b6
fix pointer error on button instantiation
edumeneses Feb 20, 2025
b1983cc
fix issue 30: noexcept removed from children instantiations
edumeneses Feb 20, 2025
fd2d4a6
remove tentative to write on pointer
edumeneses Feb 20, 2025
68867a4
convert presstime to int
edumeneses Feb 20, 2025
9019c29
add namespace to getCurrentTimeMicroseconds
edumeneses Feb 20, 2025
f9f5926
new attempt to fix the get time problem
edumeneses Feb 20, 2025
24425a6
remove threshold from button instantiation
edumeneses Feb 21, 2025
7aa8ad7
reinclude main cpp file
edumeneses Feb 21, 2025
6ca931a
update cmakelists
edumeneses Feb 21, 2025
28acd1b
remove unused update button function
edumeneses Feb 25, 2025
05c7536
fix wrong overload
edumeneses Feb 25, 2025
3c8e965
add discretizer (utils)
edumeneses Feb 25, 2025
8c948cd
add discretizer to namespace
edumeneses Feb 26, 2025
89a336c
change discretizer class name
edumeneses Feb 26, 2025
223f011
add discretizer ro utils
edumeneses Feb 26, 2025
eaa509e
clean up gestures.h
edumeneses Feb 26, 2025
7af3fdf
add threshold to jab and shake
edumeneses Mar 11, 2025
7d9d4b0
add missing jab threshold wrapper for 2D and 3D
edumeneses Mar 11, 2025
3c2248f
fix threshold behaviour in shake
edumeneses Mar 11, 2025
d409127
Merge pull request #29 from Puara/button
edumeneses Mar 14, 2025
596d40c
add simple tilt_roll
edumeneses Mar 17, 2025
8dd608a
include tilt_roll header
edumeneses Mar 17, 2025
6cae997
add method to get current individual values
edumeneses Mar 17, 2025
ef15472
Merge pull request #41 from Puara/add_simple_orientation
edumeneses Mar 17, 2025
877076d
Update README.md
edumeneses Apr 18, 2025
65f6949
Merge branch 'main' into development
edumeneses Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
BasedOnStyle: WebKit

BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterExternBlock: false
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false

# BreakBeforeConceptDeclarations: Always
# IndentRequiresClause: false
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakConstructorInitializersBeforeComma: true
BreakInheritanceList: BeforeComma
ColumnLimit: 89
CommentPragmas: "^ clang-format:"
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: OuterScope
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PackConstructorInitializers: Never
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReferenceAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 2
UseTab: Never

IncludeCategories:
- Regex: '<.*\.(c|cpp)>'
Priority: 1000
- Regex: '^"'
Priority: 10
- Regex: "^<boost"
Priority: 70
- Regex: "^<Q"
Priority: 80
- Regex: '<([[:alnum:]_]+\/)+([[:alnum:]_])+.(h|hpp)>'
Priority: 700
- Regex: '<([[:alnum:]_]+\/?)+.(h|hpp)>'
Priority: 800
- Regex: "<[[:alnum:]_]+>"
Priority: 900
41 changes: 41 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build
on:
push:

jobs:
build-project:
strategy:
matrix:
config:
- {
os: ubuntu-latest,
cmake_options: "",
dependencies: "sudo apt update -yqq && sudo apt -yqq install libboost-dev"
}
- {
os: macos-latest,
cmake_options: "CMAKE_PREFIX_PATH=/opt/homebrew",
dependencies: "brew install boost eigen && brew link boost eigen"
}
- {
os: windows-latest,
cmake_options: "Boost_INCLUDE_DIR=D:/a/puara-gestures/puara-gestures/3rdparty",
dependencies: "choco install eigen -y --no-progress"
}

runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
submodules: recursive

- name: Dependencies
run: ${{ matrix.config.dependencies }}

- name: Build Project
uses: threeal/[email protected]
with:
options: |
PUARA_GESTURES_ENABLE_STANDALONE=0
${{ matrix.config.cmake_options }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
build/
.vscode/
*.user
*code-workspace
.pio
exampleProjects/touch/.gitignore
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "IMU_Sensor_Fusion"]
path = IMU_Sensor_Fusion
url = https://github.com/malloch/IMU_Sensor_Fusion
[submodule "3rdparty"]
path = 3rdparty
url = git@github.com:Puara/3rdparty.git
1 change: 1 addition & 0 deletions 3rdparty
Submodule 3rdparty added at de118c
81 changes: 81 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
cmake_minimum_required(VERSION 3.24...3.30)

project(
puara-gestures
VERSION 0.2
LANGUAGES CXX
)

### Library options ###
option(PUARA_GESTURES_ENABLE_TESTING "Enable building and running Puara gestures tests" ON)
option(PUARA_GESTURES_ENABLE_STANDALONE "Enable building and running Puara standalone" OFF)

### Dependencies ###
if(POLICY CMP0167)
cmake_policy(SET CMP0167 OLD)
endif()

set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/3rdparty")
set(Boost_NO_SYSTEM_PATHS ON)
find_package(Boost REQUIRED)

### Main library ###
add_library(puara_gestures
3rdparty/IMU_Sensor_Fusion/imu_orientation.h
3rdparty/IMU_Sensor_Fusion/imu_orientation.cpp

include/puara/descriptors/button.h
include/puara/descriptors/jab.h
include/puara/descriptors/roll.h
include/puara/descriptors/shake.h
include/puara/descriptors/tilt.h
include/puara/descriptors/touchArrayGestureDetector.h

include/puara/utils/blobDetector.h
include/puara/utils/calibration.h
include/puara/utils/circularbuffer.h
include/puara/utils/leakyintegrator.h
include/puara/utils/maprange.h
include/puara/utils/rollingminmax.h
include/puara/utils/smooth.h
include/puara/utils/threshold.h
include/puara/utils/wrap.h

include/puara/structs.h
include/puara/gestures.h
include/puara/utils.h

src/puara_gestures.cpp

)

target_compile_definitions(puara_gestures PUBLIC $<$<BOOL:${WIN32}>:_USE_MATH_DEFINES>)
target_include_directories(puara_gestures PUBLIC include 3rdparty)
target_compile_features(puara_gestures PUBLIC cxx_std_20)
target_link_libraries(puara_gestures PUBLIC Boost::headers)

### Tests ###
if(PUARA_GESTURES_ENABLE_TESTING)
include(CTest)

target_sources(Continuous
PRIVATE
tests/testing_touch.cpp

)
add_executable(testing_roll tests/testing_roll.cpp)
add_executable(testing_tilt tests/testing_tilt.cpp)
add_executable(testing_touch tests/testing_touch.cpp)
target_compile_definitions(testing_roll PRIVATE "-DPUARA_TESTS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/testing files\"")
target_compile_definitions(testing_tilt PRIVATE "-DPUARA_TESTS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/testing files\"")
target_compile_definitions(testing_touch PRIVATE "-DPUARA_TESTS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/testing files\"")
target_link_libraries(testing_roll PRIVATE puara_gestures)
target_link_libraries(testing_tilt PRIVATE puara_gestures)
target_link_libraries(testing_touch PRIVATE puara_gestures)

endif()

### Example ###
if(PUARA_GESTURES_ENABLE_STANDALONE)
add_subdirectory(standalone)
endif()
1 change: 0 additions & 1 deletion IMU_Sensor_Fusion
Submodule IMU_Sensor_Fusion deleted from 9412e6
81 changes: 79 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,79 @@
# puara-gestures
High-level gestural descriptor functions for the Puara Framework
# Puara Gestures
The `puara-gestures` library provides a set of tools for creating and managing high-level gestural descriptors using data from various sensors such as accelerometers, gyroscopes, and magnetometers. The library includes classes for handling different types of gestures, including shakes, rolls, tilts, jabs, and touches.

## Gestures (descriptors) and Features

- **Shake**: Detects "shake" movements. It is often used on accelerometer data, but it can be applied to any 1 to 3DoF data flow.
- - **Jab**: Detects jab movements using accelerometer data.
- **Roll**: Measures roll gestures using 9DoF (IMU data) info from an accelerometer, gyroscope, and magnetometer.
- **Tilt**: Measures tilt gestures using 9DoF (IMU data) info from an accelerometer, gyroscope, and magnetometer.
- **Touch (Brush/Rub)**: Extract features for 1 to 3DoF agnostic data. It is often used to interpret standard touch features (swipe/brush, rub, positional, area, etc.) based on movement input.
- **Button**: Interaction (feature) extraction using a discrete input. It can be used for buttons or any other discrete binary data.

## Example Projects

A basic example of puara-gestures can be found on the [puara-module-templates](https://github.com/Puara/puara-module-templates/tree/main/basic-gestures) repository.
The included `exampleProjects` directory also contains example projects and is a good starting point for new users.
See [exampleProjects](/exampleProjects) for details.

## Building the Library

### Prerequisites

- CMake 3.24 or higher
- A compatible C++ compiler
- Arduino IDE (for running the example project on hardware)

### Building

To build the `puara-gestures` library, follow these steps:

1. Clone the repository:
```sh
git clone https://github.com/Puara/puara-gestures.git
cd puara-gestures
```
2. Configure the project using CMake:
```sh
cmake -B build
```
3. Build the project:
```sh
cmake --build build
```

## Usage in PlatformIO

Puara-gestures can be easily included in PlatformIo projects. The recommended method is to manually edit the `platformio.ini` file of the project and add this repository to `lib_deps`. It is recommended to specify the puara-gestures version (in the example below, we will use version 0.2.0):

```
lib_deps = https://github.com/Puara/puara-gestures.git#v0.2.0
```

If planning to use the 3rd-party library for sensor fusion, it also needs to be manually added:

```
lib_deps =
https://github.com/Puara/puara-gestures.git#v0.2.0
https://github.com/malloch/IMU_Sensor_Fusion.git
```

When using PlatformIO, it is also important to use the **espressif32** platform and **arduino** framework if using an ESP32.
To use esp-idf, it is recommended to manually copy the `src` and `include` folders into your project rather than using lib_deps.
The reason is that esp-idf will try to compile all cpp files in this project, resulting in include errors.

## Contributing with new gestures

It is easy to contribute new gestures for puara-gestures.
Gestures are organized in single-header files that contain the feature class.
We only need to add a class (header) in the [descriptors folder](include/puara/descriptors) and include it in [gestures.h](include/puara/gestures.h).


## More Info on the research related to [Puara](https://github.com/Puara)

- [SAT](http://www.sat.qc.ca)
- [IDMIL](http://www.idmil.org)

## Licensing

The code in this project is licensed under the MIT license, unless otherwise specified within the file.
49 changes: 49 additions & 0 deletions exampleProjects/touch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Touch Project

This project is part of the Puara Framework and showcases the integration of `puara-gestures` with a touchscreen in a [Wokwi](https://wokwi.com/) simulation to detect and display touch interactions.

## Project Overview

This example project has 3 main components:
- A Wokwi `diagram.json` containing a simple circuit simulation consisting of a ILI9341 touch screen and a TinyPico ESP32 development board.
- A simple `main.cpp` which mainly initiates and update a `TinyTouch` object.
- A `TinyTouch` class, which is closely tied to the Wokwi `diagram.json`, and displays rectangles on a screen to simulate a touch array. As the screen is touched, `TinyTouch` updates its `TouchArrayGestureDetector` class member (which is part of the `puara-gesture` namespace), which calculates brush and rub gestures. The resulting total `brush` and `rub` values are printed to the terminal.

## Running the Project Using Wokwi in Visual Studio Code

1. Install [Visual Studio Code](https://code.visualstudio.com/), as well as the [PlatformIO](https://platformio.org/install/ide?install=vscode) and [Wokwi](https://docs.wokwi.com/vscode/getting-started) VS Code extensions. As part of the process you'll need to create a free [Wokwi](https://wokwi.com/) online account.

2. Clone this repository and open the `exampleProjects/touch` directory in Visual Studio Code.

```sh
git clone https://github.com/Puara/puara-gestures.git
code puara-gestures/exampleProjects/touch
```

Once you open the `touch` directory in VS Code, PlatformIO should take a moment to install all the dependencies listed in `exampleProjects/touch/platformio.ini`.

3. Open the `diagram.json` file.

4. If you've never signed in your wokwi account from VS Code, or it's been more than a month since you got your last license, you might get this dialog in the bottom right of the IDE. If so, click on "Request a New License" and follow the instructions to get another free Wokwi license.

<p align="center">
<img width="450" src="https://github.com/user-attachments/assets/3502135c-9326-40aa-9887-8d796e464ff9">
</p>

5. Click on the green arrow "Start Simulation" button in the top left to build and run the project in Wokwi:

<p align="center">
<img width="600" src="https://github.com/user-attachments/assets/f073b596-53a7-4404-a2aa-0ac49ad176b6">
</p>

6. Once the simulation is started, click on the touch screen to start the touch example. Now if you "brush" and "rub" the touch screen up and down with your mouse cursor you should see `brush` and `rub` values printed in the VS Code Wokwi Terminal:

<p align="center">
<img width="600" src="https://github.com/user-attachments/assets/bafca748-f5d7-46ba-8f48-a05db5cf996e">
</p>

7. The firmware code to run this simulation is located in `exampleProjects/touch/src`. Feel free to explore and modify the code to understand how it all works. Have fun!

## License

This project is licensed under the MIT License.
Loading
Loading