11 Commits

Author SHA1 Message Date
jonny_l480
0d082a52d8 Add Screensaver, Fix timeout
Add screensaver status screen to prevent oled burn-in:
  Display task switches to screensaver status-screen
  when certain time of inactivity is exceeded
2024-03-01 23:59:00 +01:00
jonny_l480
50ee4244d3 Fix bat voltage: lookup table, currentSensors: Add snap to zero
display.cpp:
    Optimize battery voltage measurement
    While calibrating noticed it is very non-linear
    - outsource function to scale using lookup table
    - add lookup table to batvoltage measurement
      inserted many values to lookup table while testing

currentsensors:
    Fix current value jumping around between 0 and 0.2 on display
    while standstill
    - add parameter snapToZeroThreshold
2024-02-27 12:24:38 +01:00
jonny_l480
aab30abb80 Display: Add Status screens 'Motors' and 'Joystick'
Add new status screens that can be selected in menu
(status screen = display content while not in MENU mode)

- display:
    - Motors screen: shows Power usage, duty, speed
    - Joystick screen: shows all stick data and current control mode (similar to 'debug joystick' menu option

- menu:
    - disable example menu items
    - add new status screens
2024-02-26 23:05:02 +01:00
jonny_jr9
ccef663c33 Fix chairAdjust, Add different status screens (Speed)
- config, chairAdjust:
    - disable reset-pin of display (not connected, random pin was assigned)
      same pin was used for chair adjust resulting in on state after startup
    - fix chairAdjust not stopping in OFF state

- display
    - add functionality to show different status screens (content when not in MENU)
    - add status screen 'Speed' (to show speed and debug speedsensors)

- menu
    - fix item joystick define center not working
    - add item to select status screen
2024-02-24 12:25:45 +01:00
jonny_jr9
cdfa64fbc0 Add joystick-calibration wizzard (store in nvs), Optimize Menu
- menu:
    - Add item joystick calibration wizzard
    - Add item RESET (clear nvs and restart)
    - Add configuration option to not show/change value. Instead only show confirm message
      apply this to all items only running action
    - Optimize formatting and comments

- main:
    - pass nvsHandle to display task and joystick class

- joystick:
    - Add methods to write and load calibration values (axis min/max adc value) from nvs
    - Add method to get raw adc value
2024-02-21 11:30:36 +01:00
jonny_jr9
021a3660e1 Outsource display, encoder cfg to config.cpp, Optimize speedsensor
- outsource configuration of display and encoder from source/header file
  to config.cpp and pass it to init function or task from main()

- optimize logging in several init functions

- speedsensor:
    - fix startup error: initialize ISR only once
    - create instances at initialization instead of first method call

- ssd1306 display library:
    - modify library to pass offsetX to init function instead of using macro
2024-02-20 12:24:41 +01:00
jonny_jr9
2fcf17feda Major Rework all files - Pass pointers to tasks, Remove gloabl variables
- All files:
  Modify almost all files to adjust functions and classes to
  work with pointers to objects passed at task creation
  instead of global variables from config.hpp

- Remove/clear config.hpp to get rid of all global variables

- main.cpp
    - Create pointer to all shared (used in multiple tasks) objects in main

- remove evaluatedSwitch button object,
  since joystick library is used to get switch events

- changes HTTP-mode
    - always init http-server (do not enable/disable at mode change)
    - pass url-handle function to init-htpp function
    - add lambda function to pass method of instance for thatMajor Rework all files - Remove global variables, pass pointers to tasks

- All files:
  Modify almost all files to adjust functions and classes to
  work with pointers to objects passed at task creation
  instead of global variables from config.hpp

- Remove/clear config.hpp to get rid of all global variables

- main.cpp
    - Create pointer to all shared (used in multiple tasks) objects in main

- remove evaluatedSwitch button object,
  since joystick library is used to get switch events

- changes HTTP-mode
    - always init http-server (do not enable/disable at mode change)
    - pass url-handle function to init-htpp function
    - add lambda function to pass method of instance for that

NOTES:  - tested on breakoutboard only
        - known issue that slow encoder events are not recognized
        (especially in menu) - slowing down motorctl helps
2024-02-18 10:00:34 +01:00
jonny_jr9
ffac657199 Add abstracted functions for display - simplify code
Simple functions for printing a line normal, large or centered
using format string directly instead of having to use both
snprintf first and then display function all the time
This makes the code more readable and compact

Applied this optimization where applicable in manu.cpp and display.cpp
2024-02-15 23:24:41 +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_jr9
0804aaf240 Add display library, show battery voltage
untested
2023-09-09 16:51:01 +02:00