Open mariusdp opened 4 years ago
Hi! this is the right place, welcome
on my first look on your code:
you have one automated input serialIn serial(Serial);
and two menu outputs,
//define outputs controller
menuOut* outputs[]{&outSerial,&oledOut};//list of output devices
outputsList out(outputs,sizeof(outputs)/sizeof(menuOut*));//outputs list controller
on the loop:
if (nav.changed(0)) {
this will check if visible menu on device index 0 has changed and therefor needs to be drawn, on your case device index 0 is &outSerial
(not the gfx) but that should work
my question is, does your code work if you remove all the extra rotary code and delays and use serial as sole input instead? please use keys +
-
*
\
followed by enter to navigate menu on serial monitor
Thank you for looking in! Yes it works, started like that and added rotary after. The "result drawA" could never get it to loop. Tried normal delay(xxx); if millis xxx do... Even tried to use two oled drivers hopping that "draw" would be more independent - result was the same (was interesting to see it displaying menu with u8g2 and draw with adafruit_ssd1306). thank you!
PS: navigation works fine on all 3 way tried so far: serial, encoder and btn. Could never get it to work with your encoder though, that is why I added that encoder bit.
the builtin encoder was done and tested for avr's, it depends on PCINT library that eventually can work on other platforms, but not tested. There is also clickencoder driver, the original as you can see here https://github.com/0xPIT/encoder is also for AVR's but its because of its timer1 dependency and some includes that can be discarded, I've used this driver with an esp8266 just by replacing the timer and removing avr specific includes. I can provide esp8266 code fot that. Since AM4 now has code driven navigation we can adapt any input driver by just calling the navigation functions... and after that didn't worry much on providing input specif drivers...
now having a second display to for independent draw, since you want results to be fixed and updating i would use menu handler to set a drawing type flag only and then I would do an independent switch/case (inside loop) to draw updated info on the second screen and it will keep drawing updated info according to selected flag value. This is the only way to have parallel draw and free the menu for navigation
"now having a second display..." can you point me towards an example on how to achieve this? I´m kind of new to this world :P
The code for esp8266 with 0xPIT/encoder would be great.
Thank you,
Hi all,
First I apologise if I am in the wrong place, please point me in the wright place if that is the case. The issue: I attache a second i2c oled and on it it displays value read from analogue pin in "drawA, B or C". When I press on "ADC12" in "Voltmetre" menu the data is displays on the second oled but only one time (does not update/loop). The question is how can I do that??? Tried all sort of suggestions found out there but with no success. If someone can help that would be great.
THANK YOU,