Dexter is an electronic lock. The way to open and close this lock is what makes it unique. Instead of pressing one key at a time you push multiple.
Normal pass-code/pin locks use a mechanism where you can activate one key/switch at a time, for this you need a lot more keys/switches for given range.
Example:
1 2 3
4 5 6
7 8 9
0
Here you can have 10 keys giving you 0-9 and then you can chain those into some thing like 0-9-1-8-2
. This is waste of resources.
Dexter takes a better approach where you can press multiple keys a once to create a combination. Example with 5 keys your key pad will look like.
1 1 1 1 1
--- or ---
16 8 4 2 1
Now you can enter binary number between 1-30
for example
To enter | Combination |
---|---|
10 | 01010 |
15 | 01111 |
27 | 11011 |
5 bit range is 0-31
Why not 0? You can't press no keys and register it as a key press. To enter 0 you need complex timing mechanism or extra key which you can use better to double the range.
You need significantly less number of keys but more Dexterity , hence the name Dexter.
So with same number of keys you can achieve more range of number, mathematically.
Which is near exponential increase.
Dexter user experience is designed keeping few things in mind
- Humans make mistakes.
- Humans mostly realise they have made a mistake halfway through.
- Humans try to course correct the mistake.
(3) (4)
(5) (6) (7) (8) (9)...
(1) (2) [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
LED indicators:
(1)
Activity Indicator(2)
Digit Registered Indicator(3)
Success Indicator(4)
Wrong Password Indicator(5+)
Digits entered Indicator
Keys:
[1-5]
Keys ordered in MSB order
Login Flow:
- Initially the lock is in standby,
(1)
is off, to activate it press first key then(1)
pops up. - Start with your combination first digit in binary say
01101
when your are holding down given combination(2)
is blinking indicating you can press more keys. - When you lift your hand up,
(2)
stops blinking momentarily indicating your digit input has been recorded. One more LED lights up in progress bar made up of(5+)
- Once you enter correct password, lock opens and
(3)
stays lit up. - Incase of wrong password,
(4)
lights up for a few seconds.
Password Change flow:
- Once lock is unlocked, press all keys,
(3)
starts blinking, now you can enter combination like in the login flow. - Fill all the digits indicated by
(5+)
progress bar. - NOTE: You can't use
00000
and11111
in this passcode
Forgot Password:
- Break the lock, if you were smart enough to created a reset button press that enter default password.
This repository offers Dev Containers supports for:
Note
In order to use GitHub Codespaces the project needs to be published in a GitHub repository and the user needs to be part of the Codespaces beta or have the project under an organization.
If using VS Code or GitHub Codespaces, you can pull the image instead of building it
from the Dockerfile by selecting the image
property instead of build
in
.devcontainer/devcontainer.json
. Further customization of the Dev Container can
be achieved, see .devcontainer.json
reference.
When using Dev Containers, some tooling to facilitate building, flashing and simulating in Wokwi is also added.
-
Terminal approach:
scripts/build.sh [debug | release]
If no argument is passed,
release
will be used as default -
UI approach:
The default build task is already set to build the project, and it can be used in VS Code and GH Codespaces:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Build Task
command. Terminal
->Run Build Task
in the menu.- With
Ctrl-Shift-B
orCmd-Shift-B
. - From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild
. - From UI: Press
Build
on the left side of the Status Bar.
- From the Command Palette (
Note
When using GitHub Codespaces, we need to make the ports public, see instructions.
-
Terminal approach:
-
Using
flash.sh
script:scripts/flash.sh [debug | release]
If no argument is passed,
release
will be used as default
-
-
UI approach:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild & Flash
. - From UI: Press
Build & Flash
on the left side of the Status Bar.
- From the Command Palette (
-
Any alternative flashing method from host machine.
The Dev Container includes the Wokwi Vs Code installed, hence you can simulate your built projects doing the following:
- Press
F1
- Run
Wokwi: Start Simulator
Note
We assume that the project is built in
debug
mode, if you want to simulate projects in release, please update theelf
andfirmware
proprieties inwokwi.toml
.
For more information and details on how to use the Wokwi extension, see Getting Started and Debugging your code Chapter of the Wokwi documentation.
Warning
ESP32-C2 is not, yet, not supported in Wokwi.