Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev ray #112

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
96808c4
copy description of example from sketch
Bad-Assumptions Mar 15, 2023
aef68ad
copy description of example from sketch
Bad-Assumptions Mar 15, 2023
bf9a437
typo
Bad-Assumptions Mar 15, 2023
ef210e1
configuration changes supporting Magnethereal
Bad-Assumptions Jun 15, 2023
b799175
config changes
Bad-Assumptions Jun 15, 2023
2fe5275
Merge branch 'master' of https://github.com/Kentucky-Fried-Circuits/L…
Bad-Assumptions Jun 15, 2023
807d1dc
removed noisy compiler warnings
Bad-Assumptions Jun 19, 2023
b785136
updated example A for local environment
Bad-Assumptions Jun 23, 2023
cc94caf
hack to allow setting of lcd pointer at runtime
Bad-Assumptions Jun 26, 2023
c8f1e47
fix change_menu() update() bug
Bad-Assumptions Jun 27, 2023
d12235d
add access to current screen of non-current menus.
Bad-Assumptions Jun 28, 2023
ef0899a
some debug messages
Bad-Assumptions Jun 30, 2023
c0530e2
added get_menu() to LiquidSystem
Bad-Assumptions Jul 10, 2023
da6d3b3
made menu array public so I can iterate
Bad-Assumptions Jul 11, 2023
b9ce4a1
public access to screen & line arrays
Bad-Assumptions Jul 11, 2023
f1cde51
checkpoint working meter menus
Bad-Assumptions Jul 12, 2023
1635282
made more privates public
Bad-Assumptions Jul 17, 2023
61807cf
workaround conflict with DEBUG definition
Bad-Assumptions Jul 27, 2023
893e516
Merge remote-tracking branch 'upstream/master' into dev-ray
hezy0426 Aug 30, 2023
2bfd639
Fix the issue with printing
hezy0426 Aug 31, 2023
85e15f5
Update to use the correct number
hezy0426 Sep 1, 2023
27d838f
Merge pull request #1 from Kentucky-Fried-Circuits/dev-ray
Bad-Assumptions Sep 1, 2023
c7bd526
Update config again
hezy0426 Sep 12, 2023
e214d42
Merge pull request #2 from Kentucky-Fried-Circuits/dev-ray
hezy0426 Sep 12, 2023
3eaa391
Update LiquidMenu_config.h
hezy0426 Sep 18, 2023
24f1ba7
Merge pull request #3 from Kentucky-Fried-Circuits/dev-ray
hezy0426 Sep 21, 2023
60fd6c2
Fix mismatched type
hezy0426 Oct 9, 2023
4e3a763
Update max num of screen
hezy0426 Oct 17, 2023
deda6a5
Update to support the new change menu
hezy0426 Oct 30, 2023
ccbac66
Update LiquidMenu.h
hezy0426 Nov 1, 2023
53ce76f
New change menu function
hezy0426 Dec 13, 2023
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
idf_component_register(SRCS "src/LiquidScreen.cpp" "src/LiquidLine.cpp" "src/LiquidMenu.cpp" "src/recognizeType.cpp" "src/LiquidSystem.cpp"
REQUIRES DFRobot_RGBLCD1602 # component containing LiquidCrystal_I2C.h
INCLUDE_DIRS "./src")

4 changes: 2 additions & 2 deletions examples/A_hello_menu/A_hello_menu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/

// The LCD library
#include <LiquidCrystal.h>
#include <DFRobot_RGBLCD1602.h>
// The menu wrapper library
#include <LiquidMenu.h>

Expand All @@ -51,7 +51,7 @@ const byte LCD_D6 = 3;
const byte LCD_D7 = 2;
//LCD R/W pin to ground
//10K potentiometer wiper to VO
LiquidCrystal lcd(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
DFRobot_RGBLCD1602 lcd(0x68);

/*
* Variable 'analogReading' is later configured to
Expand Down
24 changes: 24 additions & 0 deletions examples/B_serial_menu/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
Example 2: serial_menu
==================
This example uses the serial communication to execute commands.

The available commands will be printed on the serial monitor.
This example uses attached callback functions which are explained
in the functions_menu.ino example.

The circuit:
https://raw.githubusercontent.com/VaSe7u/LiquidMenu/master/examples/B_serial_menu/serial_menu.png
- LCD RS pin to Arduino pin 12
- LCD E pin to Arduino pin 11
- LCD D4 pin to Arduino pin 5
- LCD D5 pin to Arduino pin 4
- LCD D6 pin to Arduino pin 3
- LCD D7 pin to Arduino pin 2
- LCD R/W pin to ground
- LCD VSS pin to ground
- LCD VDD pin to 5V
- 10k ohm potentiometer: ends to 5V and ground, wiper to LCD V0
- 150 ohm resistor from 5V to LCD Anode
- LCD Cathode to ground

Created July 24, 2016
by Vasil Kalchev


![schematic](https://github.com/VasilKalchev/LiquidMenu/blob/master/examples/B_serial_menu/serial_menu.png?raw=true)
This example uses the serial communication to execute commands.
49 changes: 49 additions & 0 deletions examples/C_functions_menu/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
Example 3: functions_menu
==================
This example demonstrates how to attach functions to the
"lines" in the menu.
*
Attaching functions to the different "lines" in the menu makes it
possible to execute an action through the menu (e.g. dimming an LED,
adjusting preferences...). To attach a function to a line you need
to create with signature "void functionName(void)". After creating it,
the function is ready to be attached to a line. To do that call bool
LiquidLine::attach_function(uint8_t number, void (*function)(void)).
LiquidLine is the line object you wish to attach the function to,
number is the "id" of the function for that line, void (*function)(void)
is just the name of the function without the "()". The "id" of the function
makes possible attaching multiple functions to a single line. An example use
of multiple functions on a single line is for incrementing or decrementing
some value (e.g. dimming an LED). It is convenient to attach all the different
incrementing functions (e.g. increase_brightness(), increase_volume()) to the
different lines (e.g. LED brightness: 5, Sound volume: 10) using the same id
(e.g. 1). Same goes for the decrementing functions (e.g. LED brightness: 5 (line)
with attached function decrease_brightness() (function) with id 2,
Sound volume: 10 (line) with attached function decrease_volume() (function) with id 2).
Similar functions should be attached to their corresponding lines with the same "id",
because then they can be called from the same event (e.g. pressing button "UP"
calls the incrementing function of whatever the focused line is).
This example has a line that shows the current PWM of the LED and lines
that allow a fade or blink loop to be turned ON/OFF and configured.

The circuit:
https://raw.githubusercontent.com/VaSe7u/LiquidMenu/master/examples/C_functions_menu/functions_menu.png
- LCD RS pin to Arduino pin 12
- LCD E pin to Arduino pin 11
- LCD D4 pin to Arduino pin 5
- LCD D5 pin to Arduino pin 4
- LCD D6 pin to Arduino pin 3
- LCD D7 pin to Arduino pin 2
- LCD R/W pin to ground
- LCD VSS pin to ground
- LCD VDD pin to 5V
- 10k ohm potentiometer: ends to 5V and ground, wiper to LCD V0
- 150 ohm resistor from 5V to LCD Anode
- LCD Cathode to ground
- ----
- Button (left) to Arduino pin A0 and ground
- Button (right) to Arduino pin 7 and ground
- Button (up) to Arduino pin 8 and ground
- Button (down) to Arduino pin 9 and ground
- Button (enter) to Arduino pin 10 and ground
- A PWM controlled device (LED...) to Arduino pin 6

Created July 24, 2016
by Vasil Kalchev
![schematic](https://github.com/VasilKalchev/LiquidMenu/blob/master/examples/C_functions_menu/functions_menu.png?raw=true)
This example demonstrates how to attach functions to the "lines" in the menu.
6 changes: 4 additions & 2 deletions src/LiquidLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ void LiquidLine::print(DisplayClass *p_liquidCrystal, bool isFocused) {
DEBUG(F("\t\t<Focus position: "));
switch (_focusPosition) {
case Position::RIGHT: {
p_liquidCrystal->write((uint8_t)15);
p_liquidCrystal->write((uint8_t)127);
DEBUGLN(F("right>"));
//p_liquidCrystal->print(NOTHING);
break;
} //case RIGHT
case Position::LEFT: {
//p_liquidCrystal->print(NOTHING);
p_liquidCrystal->setCursor(_column - 1, _row);
p_liquidCrystal->write((uint8_t)14);
p_liquidCrystal->write((uint8_t)126);
DEBUGLN(F("left>"));
break;
} //case LEFT
Expand Down Expand Up @@ -156,6 +156,7 @@ void LiquidLine::print_variable(DisplayClass *p_liquidCrystal, uint8_t number) {
case DataType::CHAR_PTR: {
char* variable = const_cast<char*>(reinterpret_cast<const char *>(_variable[number]));
DEBUG(F("(char*)")); DEBUG(variable);
ESP_LOGV("LiquidLine", "print_variable(char*):%s", variable);
p_liquidCrystal->print(variable);
break;
} //case CHAR_PTR
Expand All @@ -175,6 +176,7 @@ void LiquidLine::print_variable(DisplayClass *p_liquidCrystal, uint8_t number) {
case DataType::UINT8_T: {
const uint8_t variable = *static_cast<const uint8_t*>(_variable[number]);
DEBUG(F("(uint8_t)")); DEBUG(variable);
ESP_LOGD("LiquidLine", "print_variable(uint8_t):%i", variable);
p_liquidCrystal->print(variable);
break;
} //case UINT8_T
Expand Down
Loading
Loading