Comments (22)
I understand what you are saying by blocking systems. Good point. I think that U8G2 can help, Oliver has developed it mainly for monochrome displays and it managed full buffered screen or pages in I2C, HW SPI and so. Maybe it can worth it to have a look on that but the way it works it completely different to your current system, so...
To come back to my first question, it was just changing the way you are browsing all the available VALUES for a TOGGLE field. Instead of clicking to change from a value to an another, using up/down to browse them (after clicked once for editing mode) without changing the screen and just refreshing the value for the selected field.
from arduinomenu.
i see, very good, lets call it SELECT (?)
plus CHOOSE | SELECT can have option to update on move or update on click
right?
from arduinomenu.
browses like choose but displays like toggle... we will mix'em up
from arduinomenu.
I will soon keep you in touch about that ;)
from arduinomenu.
Yep! It's quite important for non AVR platform, e.g. stm32duino I'm using.
from arduinomenu.
In the menuFields.h file. But it define behavior on any output device, i think.
IMO it'll be better to add some extra type of fields/submenus.
from arduinomenu.
BTW extra numeric multi-field for time, date, IP-address etc... is not bad to have.
Maybe "ifdef" some of this extras as options.
from arduinomenu.
Maybe it's a good idea to have #indef for Graphics vs LCD and change the behaviors.
Note that this change can also be compatible with small display (16x2), the only problem can be the length of the VAULES displayed that could be truncated.
from arduinomenu.
I see the only problem with IP on small display, but... It's impossible to fit unfitable ;)
from arduinomenu.
I think a little... imo we need a some sort of horizontal menu for multi-field. It's need to think a bit more :)
So, offtopic...
from arduinomenu.
butons
button matrix
layouts
but agree.. lets think first
maybe we can do a better system from ground up,
the basic idea was to call function on click/activate and in some functions i use to call a field editor, this is still valid.
but the menu was blocking on early days.. to do it now field editors must be non blocking.
fields came andy because they show the value on the menu, so i implemented them as part of the system
btw, field editors can be blocking... some systems dont care
to cross menu object with screen outputs and navigation...
menu objects: should only contain descriptions and status
output objects: represent descriptions
input objects: do navigation
using Streams as inputs was a good idea?
the objective was to get down to serial comunication level
draw systems should operate in minimal and full mode
- minimal, draws only changed parts
- full, draw all block, to deal with dual buffered screens <-- not sure if its the solution, not tried yet
...
from arduinomenu.
that click and browse is the CHOOSE
from arduinomenu.
Let's go for SELECT then ;)
Nice behavior could be :
- Click to activate on browsing value mode (without changing the display appearance)
- Using Up/Down to browse the values (like on the current TOOGLE, but using up/down instead of multiple click)
- Click again to validate the current displayed value and returning to normal menu mode
Am I clear ? It seems that to closer model to this seems to be TOOGLE, but maybe CHOOSE can be easier to modify and adapt it to this new SELECT mode.
from arduinomenu.
Exactly, which also means less refresh pages and quicker edit when you are using a rotary encoder... At least I think so :D
from arduinomenu.
added new SELECT field with:
-click to enter edit mode
-rotate to change value
-click to end edit
from arduinomenu.
Fantastic ! Thanks a lot, can't wait to try v2.4 ;)
from arduinomenu.
hope it has not much bugs 🐛
from arduinomenu.
Hello Rui,
I tried to build this morning the Sketch U8Glib_menu.ino first for Teensy 3.1/3.2 boards but I'm getting some errors (see next post). So, I tried to build il for MEGA2560, and I'm also getting an error on a var type inside u8glib library, sic... I don't know why because this library usually works well in HW SPI.
Here the error output for MEGA2560 (only the end, otherwise it is a bit too long :
Arduino: 1.6.7 (Mac OS X), TD: 1.29, Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/christophepersoz/Developer/_Arduino/libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10607 -build-path "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/christophepersoz/Developer/_Arduino/libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10607 -build-path "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino"
Build options changed, rebuilding all
....
"/Users/christophepersoz/Developer/_Arduino/libraries/U8glib/utility/u8g_com_arduino_hw_spi.cpp" -o "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp/libraries/U8glib/utility/u8g_com_arduino_hw_spi.cpp.o"
/Users/christophepersoz/Developer/_Arduino/libraries/U8glib/utility/u8g_com_arduino_hw_spi.cpp: In function 'uint8_t u8g_com_arduino_hw_spi_fn(u8g_t*, uint8_t, uint8_t, void*)':
/Users/christophepersoz/Developer/_Arduino/libraries/U8glib/utility/u8g_com_arduino_hw_spi.cpp:263:37: error: invalid conversion from 'void*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
register uint8_t *ptr = arg_ptr;
^
/Users/christophepersoz/Developer/_Arduino/libraries/U8glib/utility/u8g_com_arduino_hw_spi.cpp:273:37: error: invalid conversion from 'void*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
register uint8_t *ptr = arg_ptr;
^
Using library SPI at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI
Using library U8glib in folder: /Users/christophepersoz/Developer/_Arduino/libraries/U8glib (legacy)
Using library Menu at version 2.4 in folder: /Users/christophepersoz/Developer/_Arduino/libraries/Menu
exit status 1
Error compiling for "Arduino/Genuino Mega or Mega 2560"
Let's see now the errors on a Teensy build ;)
from arduinomenu.
Here the build error I'm getting on Teensy board:
Arduino: 1.6.7 (Mac OS X), TD: 1.29, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimized (overclock), US English"
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/christophepersoz/Developer/_Arduino/libraries" -fqbn=teensy:avr:teensy31:usb=serial,speed=96opt,keys=en-us -ide-version=10607 -build-path "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp" -warnings=none -verbose "/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/christophepersoz/Developer/_Arduino/libraries" -fqbn=teensy:avr:teensy31:usb=serial,speed=96opt,keys=en-us -ide-version=10607 -build-path "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp" -warnings=none -verbose "/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino"
Build options changed, rebuilding all
...
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino5/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=129 -DARDUINO=10607 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3" "-I/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI" "-I/Users/christophepersoz/Developer/_Arduino/libraries/U8g_teensy" "-I/Users/christophepersoz/Developer/_Arduino/libraries/U8glib" "-I/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src" "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp/sketch/U8Glib_ClickEncoder_Teensy_Demo.ino.ino.cpp" -o "/var/folders/93/95zp52wn3dq81d0dgrtmj_b80000gn/T/build0da4f63f4b42a48bacd9931d3ed57970.tmp/sketch/U8Glib_ClickEncoder_Teensy_Demo.ino.ino.cpp.o"
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:29:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:102:8: warning: extra tokens at end of #endif directive [enabled by default]
#endif RSITE_ARDUINOP_MENU_LCD
^
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:27:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h: In constructor 'menuOut::menuOut(int, int, int, int)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:48:9: warning: 'menuOut::maxY' will be initialized after [-Wreorder]
int maxY;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:45:9: warning: 'int menuOut::top' [-Wreorder]
int top;//top for this device
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:56:12: warning: when initialized here [-Wreorder]
inline menuOut(int x=0x7F,int y=0x7F,int resX=1,int resY=1)
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:51:9: warning: 'menuOut::resY' will be initialized after [-Wreorder]
int resY;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:44:11: warning: 'menu* menuOut::drawn' [-Wreorder]
menu* drawn;//last drawn menu, avoiding clear/redraw
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:56:12: warning: when initialized here [-Wreorder]
inline menuOut(int x=0x7F,int y=0x7F,int resX=1,int resY=1)
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h: In constructor 'prompt::prompt(const char*)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:123:10: warning: 'prompt::enabled' will be initialized after [-Wreorder]
bool enabled;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:121:18: warning: 'promptAction prompt::action' [-Wreorder]
promptAction action;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:124:12: warning: when initialized here [-Wreorder]
inline prompt(const char * text):text(text),enabled(true),action(nothing) {}
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h: In constructor 'menuNode::menuNode(const char*)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:141:12: warning: 'menuNode::oy' will be initialized after [-Wreorder]
int ox,oy;//coordinate origin displacement
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:140:9: warning: 'int menuNode::width' [-Wreorder]
int width;//field or menu width
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:145:12: warning: when initialized here [-Wreorder]
inline menuNode(const char * text):prompt(text),ox(0),oy(0),width(32),previousMenu(NULL) {}
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h: In constructor 'menuNode::menuNode(const char*, promptAction)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:141:12: warning: 'menuNode::oy' will be initialized after [-Wreorder]
int ox,oy;//coordinate origin displacement
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:140:9: warning: 'int menuNode::width' [-Wreorder]
int width;//field or menu width
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menu.h:146:12: warning: when initialized here [-Wreorder]
inline menuNode(const char * text,promptAction action):prompt(text,action),ox(0),oy(0),width(32) {}
^
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:28:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In member function 'virtual bool menuVariant<T>::needRedraw(menuOut&, bool)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:139:56: error: there are no arguments to 'pgm_read_ptr_near' that depend on a template parameter, so a declaration of 'pgm_read_ptr_near' must be available [-fpermissive]
bool nr=((menuValue<T>*)pgm_read_ptr_near(&data[sel]))->value!=target;//||p.lastSel!=sel;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:139:56: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In member function 'void menuVariant<T>::sync()':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:147:52: error: there are no arguments to 'pgm_read_ptr_near' that depend on a template parameter, so a declaration of 'pgm_read_ptr_near' must be available [-fpermissive]
if (((menuValue<T>*)pgm_read_ptr_near(&data[n]))->value==target)
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In member function 'virtual void menuVariant<T>::printTo(menuOut&)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:153:42: error: there are no arguments to 'pgm_read_ptr_near' that depend on a template parameter, so a declaration of 'pgm_read_ptr_near' must be available [-fpermissive]
((prompt*)pgm_read_ptr_near(&data[sel]))->printTo(p);
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In member function 'virtual bool menuSelect<T>::needRedraw(menuOut&, bool)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:182:67: error: there are no arguments to 'pgm_read_ptr_near' that depend on a template parameter, so a declaration of 'pgm_read_ptr_near' must be available [-fpermissive]
return ((menuValue<T>*)pgm_read_ptr_near(&menu::data[menu::sel]))->value!=menuVariant<T>::target;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In member function 'virtual void menuSelect<T>::printTo(menuOut&)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:188:54: error: there are no arguments to 'pgm_read_ptr_near' that depend on a template parameter, so a declaration of 'pgm_read_ptr_near' must be available [-fpermissive]
((prompt*)pgm_read_ptr_near(&menu::data[menu::sel]))->printTo(p);
^
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:29:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h: In constructor 'menuU8G::menuU8G(U8GLIB&, unsigned char, unsigned char, unsigned char, unsigned char, uint8_t, uint8_t)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:31:13: warning: 'menuU8G::gfx' will be initialized after [-Wreorder]
U8GLIB& gfx;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:25:18: warning: 'unsigned char menuU8G::bgColor' [-Wreorder]
unsigned char bgColor;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:32:5: warning: when initialized here [-Wreorder]
menuU8G(
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:27:18: warning: 'menuU8G::disabledColor' will be initialized after [-Wreorder]
unsigned char disabledColor;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:24:18: warning: 'unsigned char menuU8G::hiliteColor' [-Wreorder]
unsigned char hiliteColor;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:32:5: warning: when initialized here [-Wreorder]
menuU8G(
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:29:17: warning: 'menuU8G::disabledColorHi' will be initialized after [-Wreorder]
unsigned char disabledColorHi;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:48:63: warning: base 'menuOut' [-Wreorder]
menuOut(gfx.getWidth()/resX,gfx.getHeight()/resY,resX,resY)
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:32:5: warning: when initialized here [-Wreorder]
menuU8G(
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h: In member function 'virtual void menuU8G::printMenu(menu&, bool)':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuU8G.h:92:56: error: 'pgm_read_ptr_near' was not declared in this scope
printPrompt(*(prompt*)pgm_read_ptr_near(&m.data[i]),i == m.sel,i+1,m.ox,(i-top)+m.oy,m.width);
^
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:28:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'menuField<T>::menuField(T&, const char*, const char*, T, T, T, T, bool (*)()) [with T = int]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:69:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:57:26: warning: 'menuField<int>::func' will be initialized after [-Wreorder]
promptFeedback (*func)();
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:56:8: warning: 'bool menuField<int>::tunning' [-Wreorder]
bool tunning;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:60:3: warning: when initialized here [-Wreorder]
menuField(T &value,const char * text,const char *units,T low,T high,T step,T tune=0,promptFeedback (*func)()=nothing)
^
In file included from /Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:28:0:
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'void menuVariant<T>::sync() [with T = bool]':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:261:64: required from 'menuToggle<T>::menuToggle(const char*, unsigned int, menuValue<T>* const*, T&) [with T = bool]'
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:59:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:147:52: error: 'pgm_read_ptr_near' was not declared in this scope
if (((menuValue<T>*)pgm_read_ptr_near(&data[n]))->value==target)
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'void menuVariant<T>::sync() [with T = int]':
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:226:64: required from 'menuChoice<T>::menuChoice(const char*, unsigned int, menuValue<T>* const*, T&) [with T = int]'
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:81:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:147:52: error: 'pgm_read_ptr_near' was not declared in this scope
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'void menuVariant<T>::printTo(menuOut&) [with T = int]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:153:42: error: 'pgm_read_ptr_near' was not declared in this scope
((prompt*)pgm_read_ptr_near(&data[sel]))->printTo(p);
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'bool menuVariant<T>::needRedraw(menuOut&, bool) [with T = int]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:139:56: error: 'pgm_read_ptr_near' was not declared in this scope
bool nr=((menuValue<T>*)pgm_read_ptr_near(&data[sel]))->value!=target;//||p.lastSel!=sel;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'bool menuChoice<T>::activate(menuOut&, Stream&, bool) [with T = int]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:244:76: error: 'pgm_read_ptr_near' was not declared in this scope
menuValue<T>* cp=(menuValue<T>*)pgm_read_ptr_near(&this->menu::data[op]);
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'void menuVariant<T>::printTo(menuOut&) [with T = bool]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:153:42: error: 'pgm_read_ptr_near' was not declared in this scope
((prompt*)pgm_read_ptr_near(&data[sel]))->printTo(p);
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'bool menuVariant<T>::needRedraw(menuOut&, bool) [with T = bool]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:139:56: error: 'pgm_read_ptr_near' was not declared in this scope
bool nr=((menuValue<T>*)pgm_read_ptr_near(&data[sel]))->value!=target;//||p.lastSel!=sel;
^
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h: In instantiation of 'bool menuToggle<T>::activate(menuOut&, Stream&, bool) [with T = bool]':
/Users/christophepersoz/Library/Mobile Documents/com~apple~CloudDocs/Developer/_Arduino/libraries/Menu/examples/U8Glib_ClickEncoder_Teensy_Demo.ino/U8Glib_ClickEncoder_Teensy_Demo.ino.ino:121:1: required from here
/Users/christophepersoz/Developer/_Arduino/libraries/Menu/src/menuFields.h:268:82: error: 'pgm_read_ptr_near' was not declared in this scope
menuValue<T>* cp=(menuValue<T>*)pgm_read_ptr_near(&this->menu::data[menu::sel]);
^
Using library SPI at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI
Using library U8g_teensy in folder: /Users/christophepersoz/Developer/_Arduino/libraries/U8g_teensy (legacy)
Using library U8glib in folder: /Users/christophepersoz/Developer/_Arduino/libraries/U8glib (legacy)
Using library Menu at version 2.4 in folder: /Users/christophepersoz/Developer/_Arduino/libraries/Menu
Error compiling for "Teensy 3.2 / 3.1"
And for both, the Sketch U8Glib_ClickEncoder_Teensy_Demo.ino.ino
is the one include in the v2.4 named U8Glib_menu.ino
with the following changes at the beginning to have the same Sketch for 2 different boards.
#if defined(__AVR_ATmega2560__)
#include <U8glib.h>
#elif defined (__MK20DX256__) || defined(__MK20DX128__) // Teensy 3.2, 3.1 and 3.0
#include <avr/pgmspace.h>
#include <SPI.h> // SPI transaction library
#include <U8g_teensy.h> // OLED display driver u8g_teensy
#else
#error "DEFINE YOUR BOARD TYPE HERE"
#endif
#include <menu.h>//menu macros and objects
#include <menuFields.h>
#include <menuU8G.h>
#define U8_DC 9
#define U8_CS 10
#define U8_RST 7
#if defined(__AVR_ATmega2560__)
U8GLIB_NHD31OLED_GR u8g(U8_CS, U8_DC, U8_RST);
//U8GLIB_PCD8544 u8g(U8_CS, U8_DC, U8_RST) ;
#elif defined (__MK20DX256__) || defined(__MK20DX128__) // Teensy 3.2, 3.1 and 3.0
U8GLIB u8g(&u8g_dev_ssd1322_nhd31oled_2x_gr_hw_spi, u8g_com_hw_spi_fn); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11)
#else
#error "U8GLIB DISPLAY NEEDED"
#endif
menuU8G gfx(u8g,1,0,1,1,7,9);
As you see, there much is much more issues on Teensy. Maybe they are all linked. The main concern is pgm_read_ptr_near
which seems not recognized.
from arduinomenu.
avr/pgmspace.h is the file for pgm_read_ptr_near
strange...
I'm trying to install teensy board defs on 1.6.10 to track that
even with that file included on menuFields.h the erros persist, saying its not defined
http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html
but it should work on 2560
please move the line
#include <avr/pgmspace.h>
out of the #if so that the 2560 also has the include
from arduinomenu.
can you open this as a new issue.. "errors building for teensy" or something like that?
from arduinomenu.
Ok, just pushed some changes to allow conditional usage of flash memory, pgm is very specific to AVR's I guess
now you must use
#define USEPGM
in your sketch before any menu includes to activate the PROGMEM usage
otherwise ram will be used (teensy seems to have a lot of ram)
and of course do not use that USEPGM on teensy
from arduinomenu.
Related Issues (20)
- is your library compatible with this LCD Library? HOT 1
- "dynamic initialization" linking error when combining Menu::style and using rotaryEventIn.h
- EDIT via rotary encoder
- is your libary compatible with OLED display with 1309 controller
- Use of SSD1306ASCII_OUT HOT 1
- Not working without serial connection HOT 1
- TFT_eSPI and FreeFont (custom font) HOT 1
- error: reference to 'config' is ambiguous
- Full graphic smart controller - cannot get the ecnoder to scroll nicely
- Disable SerialOut HOT 1
- Starting integration of LCDGFX display driver with ArduinoMenu HOT 1
- Events on SELECT-submenu out of sync
- Feature Request: Have a way to disable a menu entry by default
- After defining MENU_DEBUG project doesn't compile for ESP32
- Example request: A working ESP32WebMenu example would be nice
- SubMenu does not respond unless extra menu item is added
- noMacros example should also show how to incorporate inputs and outputs without macros
- Doesn't compile with latest board ESP32 v. 3.0.0-alpha2
- Hide a menu
- Support for EA DOGM series of displays using SSD1803 controller IC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinomenu.