7 Commits

Author SHA1 Message Date
jonny_jr9
4f8c421168 Integrate menu into control, Rework prev. button menu
Armchair functions as before (all tasks enabled).
Note: probably wrong encoder pin set in encoder.hpp

Old button menu works as usual (opimized code).
You can switch to new MENU state with 1x long press
and exit the menu with 1x long press

button.cpp: - use encoder queue instead of evaluated switch
            - simplify code, rework actions

control.cpp: Add MENU state/mode
            -> control task: turns motors off and idles
            -> button task idles  (button menu disabled)
            -> display task switches state to handle menu
control.cpp: Optimize structure:
            Add methods to freeze stick and toggle stick mapping

display.cpp: show status screen or handle menu depending on mode, simpilfy task

main.cpp: re-enable button task, disable buzzer logging

menu.cpp: Change events, Add menu exit condition
2024-02-14 13:40:46 +01:00
jonny_jr9
fc5aad0c14 Add menu (display + encoder) functional - wip
Added functional menu using display and encoder:
    - a menu item is defined in one struct
    - scroll in a list of defined items
    - select option
    - modify value
    - save value, return to list
Currently only menu is run (button and status display disabled)

- Add menu.cpp/hpp
- Add encoder.cpp/hpp mostly from previous test in board-control
- display.cpp: only run new handleMenu() function
- main.cpp: initialize encoder at startup, disable button task for testing
2024-02-13 19:36:06 +01:00
jonny_jr9
f16b96c100 Optimize Display: show current mode, git-tag...
Currently testing with breakoutboard and larger
1.3'' display (OFFSETX needed)
- display.cpp:
    - change structure (outsource in page functions)
    - add git and compile info to startup screen
    - add armchair mode and motor current to status screen
- control.hpp: Add methods to get current armchair control mode (string)
- motorctl.hpp: Add method to get motor current
2024-02-12 23:00:31 +01:00
jonny_l480
69a421a924 Outsource speedsensor, Display: show speed
- move speedsensor files from motorctl pcb to common
- single pcb create and configure global speedsensor objects
- display: create fast slow veryslow loop
  - clear display every 30s
  - show speed in rpm and km/h
  NOTE: speedsensor needs fix, direction unreliable
2023-09-12 16:00:20 +02:00
jonny_jr9
47d7e9f3a4 Rework display: separate task, add battery percent
slightly rework hacked display test
- new code structure
- split code in several functions
- add task for display instead of running it in main()
- functions to convert voltage to battery percent charged
- show percentage and voltage on display
2023-09-12 11:49:08 +02:00
jonny_l480
d9deddf923 Display: show battery voltage, Button longPress=calibrate 2023-09-09 18:03:54 +02:00
jonny_jr9
0804aaf240 Add display library, show battery voltage
untested
2023-09-09 16:51:01 +02:00