neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
957 stars 193 forks source link

Not compiling using ClickEncoder #133

Closed Triscus closed 7 years ago

Triscus commented 7 years ago

Hello,

my first try was to adapt the ucglib example , so I can use it with the SSD1351 Display and a click Encoder.

The display works fine with SerialIn, but I am struggling to get the sketch running with a clickEncoder, any help is appreciated.

I am using a Teensy 3.2 and the Encoder Library from here : https://github.com/0xPIT/encoder

Find the sketch and the relevant debug Output below:

/********************
Arduino generic menu system
UCGLib menu example
UCGLib: https://github.com/olikraus/Ucglib_Arduino

Sep. 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com

menu on UCGLib device
output: ST7735
input: Serial
mcu: nano328p
*/

#include <SPI.h>
#include <Ucglib.h>
#include <menu.h>
#include <menuIO/UCGLibOut.h>
#include <menuIO/chainStream.h>
#include <menuIO/clickEncoderIn.h>
#include <ClickEncoder.h>

using namespace Menu;

#define UC_Width 128
#define UC_Height 128

#ifdef ESP8266
#define UC_CS   10
#define UC_DC   9
#define UC_RST  6
#else
#define UC_CS   10
#define UC_DC   9
#define UC_RST  6
#endif

//font size plus margins
#define fontX 6
#define fontY 11

Ucglib_SSD1351_18x128x128_FT_HWSPI ucg(UC_DC, UC_CS, UC_RST);

const char* constMEM hexDigit MEMMODE = "0123456789ABCDEF";
const char* constMEM hexNr[] MEMMODE = { "0","x",hexDigit,hexDigit };
char buf1[] = "0x11";//<-- menu will edit this text

int chooseTest = -1;
CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
    , VALUE("First", 1, doNothing, noEvent)
    , VALUE("Second", 2, doNothing, noEvent)
    , VALUE("Third", 3, doNothing, noEvent)
    , VALUE("Last", -1, doNothing, noEvent)
);

MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle
    , OP("Op1", doNothing, noEvent)
    , EDIT("Hex", buf1, hexNr, doNothing, noEvent, noStyle)
    , SUBMENU(chooseMenu)
    , EXIT("<Back")
);

#define MAX_DEPTH 2

//define colors
#define BLACK {0,0,0}
#define BLUE {0,0,255}
#define GRAY {128,128,128}
#define WHITE {255,255,255}
#define YELLOW {255,255,0}
#define RED {255,0,0}

const colorDef<rgb> colors[] MEMMODE = {
    { { BLACK,BLACK },{ BLACK,BLUE,BLUE } },//bgColor
    { { GRAY,GRAY },{ WHITE,WHITE,WHITE } },//fgColor
    { { WHITE,BLACK },{ YELLOW,YELLOW,RED } },//valColor
    { { WHITE,BLACK },{ WHITE,YELLOW,YELLOW } },//unitColor
    { { WHITE,GRAY },{ BLACK,BLUE,WHITE } },//cursorColor
    { { WHITE,YELLOW },{ BLUE,RED,RED } },//titleColor
};

#define offsetX 0
#define offsetY 0

MENU_OUTPUTS(out, MAX_DEPTH
    , UCG_OUT(ucg, colors, fontX, fontY, offsetX, offsetY, { 0,0,UC_Width / fontX,UC_Height / fontY })
    , SERIAL_OUT(Serial)
);

ClickEncoder qEnc(3, 4, 5, 1, LOW);
ClickEncoderStream encStream(qEnc, 1);                                     

NAVROOT(nav, mainMenu, MAX_DEPTH, encStream, out);

//initializing output and menu nav without macros
/*const panel default_serial_panels[] MEMMODE={{0,0,40,10}};
navNode* default_serial_nodes[sizeof(default_serial_panels)/sizeof(panel)];
panelsList default_serial_panel_list(
default_serial_panels,
default_serial_nodes,
sizeof(default_serial_panels)/sizeof(panel)
);

//define output device
idx_t serialTops[MAX_DEPTH]={0};
serialOut outSerial(*(Print*)&Serial,serialTops);

//define outputs controller
idx_t ucg_tops[MAX_DEPTH];
PANELS(ucgPanels,{0,0,UC_Width/fontX,UC_Height/fontY});
UCGLibOut ucgOut(ucg,colors,ucg_tops,ucgPanels,fontX,fontY);

menuOut* const outputs[] MEMMODE={&outSerial,&ucgOut};//list of output devices
outputsList out(outputs,2);//outputs list controller

//define navigation root and aux objects
navNode nav_cursors[MAX_DEPTH];//aux objects to control each level of navigation
navRoot nav(mainMenu, nav_cursors, MAX_DEPTH, Serial, out);*/

void setup(void)
{
        SPI.setMOSI(11);
    Serial.begin(115200);
    while (!Serial);
    ucg.begin(UCG_FONT_MODE_TRANSPARENT);
    ucg.clearScreen();
    ucg.setFont(ucg_font_courB08_tr);//choose fized width font (monometric)
    ucg.setColor(255, 255, 255);
    ucg.setFontPosTop();
    ucg.print("Menu 4.x ucg");
    delay(1000);
    ucg.clearScreen();
    ucg.setFontPosBottom();
}

void loop(void)
{
    nav.poll();
}

Here is the Build log:

Building project code ...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=137 -DARDUINO=10801 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3" -I"C:\Users\Triscus\Documents\Arduino\libraries\SPI" -I"C:\Users\Triscus\Documents\Arduino\libraries\Ucglib_Arduino\src" -I"C:\Users\Triscus\Documents\Arduino\libraries\ArduinoMenu\src" -I"C:\Users\Triscus\Documents\Arduino\libraries\encoder" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries" -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\53ggn0bh.0i3\Micro Platforms\default\debuggers" -I"C:\Users\Triscus\Documents\Arduino\libraries" "C:\Users\Triscus\AppData\Local\Temp\VMBuilds\UCGLib_test\teensy31\Release\UCGLib_test.cpp" -o "C:\Users\Triscus\AppData\Local\Temp\VMBuilds\UCGLib_test\teensy31\Release\UCGLib_test.cpp.o"

UCGLib_test.ino:15: In file included from
UCGLibOut.h: In member function virtual size_t Menu::UCGLibOut::write(uint8_t)

UCGLibOut.h: 46:53: warning: no return statement in function returning non-void [-Wreturn-type]
   size_t write(uint8_t ch) override {gfx.write(ch);}

UCGLib_test.ino:17: In file included from
clickEncoderIn.h: At global scope

clickEncoderIn.h: 45:9: error: 'ClickEncoder' does not name a type
   ClickEncoder &enc; \\associated hardware clickEncoder

clickEncoderIn.h: 49:9: error: 'ClickEncoder' does not name a type
         ClickEncoder*: Button btn

clickEncoderIn.h: 58:41: error: expected ')' before '&' token
   ClickEncoderStream(ClickEncoder &enc,int sensivity)
clickEncoderIn.h: In member function void Menu::ClickEncoderStream::update()

clickEncoderIn.h: 52:18: error: 'enc' was not declared in this scope
   pos += enc.getValue()

clickEncoderIn.h: 54:15: error: 'btn' was not declared in this scope
           if (btn == ClickEncoder*: Open)\\do not override previous input

clickEncoderIn.h: 54:22: error: 'ClickEncoder' has not been declared
           if (btn == ClickEncoder*: Open)\\do not override previous input
clickEncoderIn.h: In member function virtual int Menu::ClickEncoderStream::peek()

clickEncoderIn.h: 78:15: error: 'btn' was not declared in this scope
           if (btn == ClickEncoder*: Clicked)

clickEncoderIn.h: 78:22: error: 'ClickEncoder' has not been declared
           if (btn == ClickEncoder*: Clicked)

clickEncoderIn.h: 81:15: error: 'btn' was not declared in this scope
           if (btn == ClickEncoder*: DoubleClicked)

clickEncoderIn.h: 81:22: error: 'ClickEncoder' has not been declared
           if (btn == ClickEncoder*: DoubleClicked)

clickEncoderIn.h: 84:11: error: 'btn' was not declared in this scope
           btn=ClickEncoder*: Open;\\2017, must consume not used input to proceed

clickEncoderIn.h: 84:15: error: 'ClickEncoder' has not been declared
           btn=ClickEncoder*: Open;\\2017, must consume not used input to proceed
clickEncoderIn.h: In member function virtual int Menu::ClickEncoderStream::read()

clickEncoderIn.h: 97:13: error: 'btn' was not declared in this scope
             btn = ClickEncoder*: Open

clickEncoderIn.h: 97:19: error: 'ClickEncoder' has not been declared
             btn = ClickEncoder*: Open
clickEncoderIn.h: In member function virtual void Menu::ClickEncoderStream::flush()

clickEncoderIn.h: 106:13: error: 'btn' was not declared in this scope
             btn=ClickEncoder*: Open;\\2017 clear current key

clickEncoderIn.h: 106:17: error: 'ClickEncoder' has not been declared
             btn=ClickEncoder*: Open;\\2017 clear current key

menuBase.h:28: In file included from
menu.h:20: from
UCGLib_test.ino:13: from
UCGLib_test.ino: At global scope
macros.h: 305:41: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(menuValueShadow<typeof(target)>*)&choice##cnt##ShadowRaw
macros.h:291: note  in expansion of macro _MK_VALUE
   #define GET_VALUE(_1,_2,_3,_4,_5,_6,NAME,...) NAME
macros.h:293: note  in expansion of macro GET_VALUE
   #define MK_VALUE(...) GET_VALUE(__VA_ARGS__,_MK_VALUE,_MK_VALUE,_MK_VALUE,_MK_VALUE,IGNORE,_MK_VALUE)(__VA_ARGS__)
macros.h:288: note  in expansion of macro MK_VALUE
   #define DECL_VALUE(target,...) MK_VALUE(target, _##__VA_ARGS__)
baseMacros.h:64: note  in expansion of macro DECL_VALUE
   what(params,x)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:190: note  in expansion of macro XFOR_EACH
   XFOR_EACH(DECL_VALUE,target,__VA_ARGS__)
macros.h:186: note  in expansion of macro altVARIANT
 #define CHOOSE(...) altVARIANT(Menu*: choose,((systemStyles)(Menu::_menuData|Menu::_canNav|Menu::_isVariant)),__VA_ARGS__)
UCGLib_test.ino:50: note  in expansion of macro CHOOSE
   CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
macros.h: 305:41: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(menuValueShadow<typeof(target)>*)&choice##cnt##ShadowRaw
macros.h:291: note  in expansion of macro _MK_VALUE
   #define GET_VALUE(_1,_2,_3,_4,_5,_6,NAME,...) NAME
macros.h:293: note  in expansion of macro GET_VALUE
   #define MK_VALUE(...) GET_VALUE(__VA_ARGS__,_MK_VALUE,_MK_VALUE,_MK_VALUE,_MK_VALUE,IGNORE,_MK_VALUE)(__VA_ARGS__)
macros.h:288: note  in expansion of macro MK_VALUE
   #define DECL_VALUE(target,...) MK_VALUE(target, _##__VA_ARGS__)
baseMacros.h:61: note  in expansion of macro DECL_VALUE
   what(params,x)
baseMacros.h:65: note  in expansion of macro XFOR_EACH_3
   XFOR_EACH_3(what, params,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:190: note  in expansion of macro XFOR_EACH
   XFOR_EACH(DECL_VALUE,target,__VA_ARGS__)
macros.h:186: note  in expansion of macro altVARIANT
 #define CHOOSE(...) altVARIANT(Menu*: choose,((systemStyles)(Menu::_menuData|Menu::_canNav|Menu::_isVariant)),__VA_ARGS__)
UCGLib_test.ino:50: note  in expansion of macro CHOOSE
   CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
macros.h: 305:41: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(menuValueShadow<typeof(target)>*)&choice##cnt##ShadowRaw
macros.h:291: note  in expansion of macro _MK_VALUE
   #define GET_VALUE(_1,_2,_3,_4,_5,_6,NAME,...) NAME
macros.h:293: note  in expansion of macro GET_VALUE
   #define MK_VALUE(...) GET_VALUE(__VA_ARGS__,_MK_VALUE,_MK_VALUE,_MK_VALUE,_MK_VALUE,IGNORE,_MK_VALUE)(__VA_ARGS__)
macros.h:288: note  in expansion of macro MK_VALUE
   #define DECL_VALUE(target,...) MK_VALUE(target, _##__VA_ARGS__)
baseMacros.h:58: note  in expansion of macro DECL_VALUE
   what(params,x)
baseMacros.h:62: note  in expansion of macro XFOR_EACH_2
   XFOR_EACH_2(what, params, __VA_ARGS__)
baseMacros.h:65: note  in expansion of macro XFOR_EACH_3
   XFOR_EACH_3(what, params,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:190: note  in expansion of macro XFOR_EACH
   XFOR_EACH(DECL_VALUE,target,__VA_ARGS__)
macros.h:186: note  in expansion of macro altVARIANT
 #define CHOOSE(...) altVARIANT(Menu*: choose,((systemStyles)(Menu::_menuData|Menu::_canNav|Menu::_isVariant)),__VA_ARGS__)
UCGLib_test.ino:50: note  in expansion of macro CHOOSE
   CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
macros.h: 305:41: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(menuValueShadow<typeof(target)>*)&choice##cnt##ShadowRaw
macros.h:291: note  in expansion of macro _MK_VALUE
   #define GET_VALUE(_1,_2,_3,_4,_5,_6,NAME,...) NAME
macros.h:293: note  in expansion of macro GET_VALUE
   #define MK_VALUE(...) GET_VALUE(__VA_ARGS__,_MK_VALUE,_MK_VALUE,_MK_VALUE,_MK_VALUE,IGNORE,_MK_VALUE)(__VA_ARGS__)
macros.h:288: note  in expansion of macro MK_VALUE
   #define DECL_VALUE(target,...) MK_VALUE(target, _##__VA_ARGS__)
baseMacros.h:56: note  in expansion of macro DECL_VALUE
   #define XFOR_EACH_1(what, params, x, ...) what(params,x)
baseMacros.h:59: note  in expansion of macro XFOR_EACH_1
   XFOR_EACH_1(what, params,  __VA_ARGS__)
baseMacros.h:62: note  in expansion of macro XFOR_EACH_2
   XFOR_EACH_2(what, params, __VA_ARGS__)
baseMacros.h:65: note  in expansion of macro XFOR_EACH_3
   XFOR_EACH_3(what, params,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:190: note  in expansion of macro XFOR_EACH
   XFOR_EACH(DECL_VALUE,target,__VA_ARGS__)
macros.h:186: note  in expansion of macro altVARIANT
 #define CHOOSE(...) altVARIANT(Menu*: choose,((systemStyles)(Menu::_menuData|Menu::_canNav|Menu::_isVariant)),__VA_ARGS__)
UCGLib_test.ino:50: note  in expansion of macro CHOOSE
   CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
macros.h: 253:63: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   constMEM Menu*: promptShadow& opShadow##cnt=*(promptShadow*)&opShadowRaw##cnt
macros.h:49: note  in expansion of macro DECL_OP_
   #define DECL(x) DECL_##x
baseMacros.h:17: note  in expansion of macro DECL
   what(x)
baseMacros.h:7: note  in expansion of macro FOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:109: note  in expansion of macro FOR_EACH_
   #define FOR_EACH(what, x, ...) FOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, x, __VA_ARGS__)
macros.h:168: note  in expansion of macro FOR_EACH
   FOR_EACH(DECL,__VA_ARGS__)
macros.h:165: note  in expansion of macro altMENU
 #define MENU(id,text,aFn,mask,style,...) altMENU(Menu*: menu,id,text,aFn,mask,style,(Menu::_menuData|Menu::_canNav),__VA_ARGS__)
UCGLib_test.ino:57: note  in expansion of macro MENU
   MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle
macros.h: 231:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   constMEM Menu*: promptShadow& opShadow##cnt=*(Menu::promptShadow*)&opShadowRaw##cnt
macros.h:49: note  in expansion of macro DECL_EXIT_
   #define DECL(x) DECL_##x
baseMacros.h:9: note  in expansion of macro DECL
   #define FOR_EACH_1(what, x, ...) what(x)
baseMacros.h:12: note  in expansion of macro FOR_EACH_1
   FOR_EACH_1(what,  __VA_ARGS__)
baseMacros.h:15: note  in expansion of macro FOR_EACH_2
   FOR_EACH_2(what, __VA_ARGS__)
baseMacros.h:18: note  in expansion of macro FOR_EACH_3
   FOR_EACH_3(what,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro FOR_EACH_4
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:109: note  in expansion of macro FOR_EACH_
   #define FOR_EACH(what, x, ...) FOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, x, __VA_ARGS__)
macros.h:168: note  in expansion of macro FOR_EACH
   FOR_EACH(DECL,__VA_ARGS__)
macros.h:165: note  in expansion of macro altMENU
 #define MENU(id,text,aFn,mask,style,...) altMENU(Menu*: menu,id,text,aFn,mask,style,(Menu::_menuData|Menu::_canNav),__VA_ARGS__)
UCGLib_test.ino:57: note  in expansion of macro MENU
   MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle

menuBase.h:28: In file included from
menu.h:20: from
UCGLib_test.ino:13: from

macros.h: 94:7: error: 'serialOut' in namespace 'Menu' does not name a type
 Menu*: serialOut id##n(port,id##Tops##n)
macros.h:73: note  in expansion of macro VAR_SERIAL_OUT
   #define CALL__(a,b,...) a##_##b(__VA_ARGS__)
macros.h:72: note  in expansion of macro CALL__
   #define CALL_(...) CALL__(__VA_ARGS__)
macros.h:67: note  in expansion of macro CALL_
   #define CALL(a,b) CALL_(HEAD_##a,HEAD_##b,TAIL_##a,TAIL_##b)
macros.h:67: note  in expansion of macro HEAD_WITH
   #define CALL(a,b) CALL_(HEAD_##a,HEAD_##b,TAIL_##a,TAIL_##b)
baseMacros.h:56: note  in expansion of macro CALL
   #define XFOR_EACH_1(what, params, x, ...) what(params,x)
baseMacros.h:59: note  in expansion of macro XFOR_EACH_1
   XFOR_EACH_1(what, params,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_2
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:159: note  in expansion of macro XFOR_EACH
Error compiling project sources
   XFOR_EACH(CALL,WITH(VAR,id,maxDepth),__VA_ARGS__)
UCGLib_test.ino:86: note  in expansion of macro MENU_OUTPUTS
   MENU_OUTPUTS(out, MAX_DEPTH

UCGLib_test.ino: 86:14: error: 'out8' was not declared in this scope
   MENU_OUTPUTS(out, MAX_DEPTH
macros.h:147: note  in definition of macro REF_SERIAL_OUT
   #define REF_SERIAL_OUT(id,md,n,...) &id##n
macros.h:72: note  in expansion of macro CALL__
   #define CALL_(...) CALL__(__VA_ARGS__)
macros.h:67: note  in expansion of macro CALL_
   #define CALL(a,b) CALL_(HEAD_##a,HEAD_##b,TAIL_##a,TAIL_##b)
macros.h:67: note  in expansion of macro TAIL_WITH
   #define CALL(a,b) CALL_(HEAD_##a,HEAD_##b,TAIL_##a,TAIL_##b)
baseMacros.h:56: note  in expansion of macro CALL
   #define XFOR_EACH_1(what, params, x, ...) what(params,x)
baseMacros.h:59: note  in expansion of macro XFOR_EACH_1
   XFOR_EACH_1(what, params,  __VA_ARGS__)
baseMacros.h:7: note  in expansion of macro XFOR_EACH_2
   #define CONCATENATE2(arg1, arg2)  arg1##arg2
baseMacros.h:112: note  in expansion of macro XFOR_EACH_
   #define XFOR_EACH(what, params , x, ...) XFOR_EACH_(FOR_EACH_NARG(x, __VA_ARGS__), what, params, x, __VA_ARGS__)
macros.h:161: note  in expansion of macro XFOR_EACH
   XFOR_EACH(CALL,WITH(REF,id,maxDepth),__VA_ARGS__)
UCGLib_test.ino:86: note  in expansion of macro MENU_OUTPUTS
   MENU_OUTPUTS(out, MAX_DEPTH

UCGLib_test.ino: 93:37: error: no matching function for call to 'Menu::ClickEncoderStream::ClickEncoderStream(ClickEncoder&, int)
   ClickEncoderStream encStream(qEnc, 1);                                       \\ Pass reference to ClickEncoderStream library

UCGLib_test.ino:17: In file included from
clickEncoderIn.h:43: note  candidate  Menu  ClickEncoderStream  ClickEncoderStream()
     class ClickEncoderStream*: public menuIn {
clickEncoderIn.h:43: note    candidate expects 0 arguments, 2 provided
clickEncoderIn.h:43: note  candidate  constexpr Menu  ClickEncoderStream  ClickEncoderStream(const Menu  ClickEncoderStream&)
clickEncoderIn.h:43: note    candidate expects 1 argument, 2 provided
clickEncoderIn.h:43: note  candidate  constexpr Menu  ClickEncoderStream  ClickEncoderStream(Menu  ClickEncoderStream&&)
clickEncoderIn.h:43: note    candidate expects 1 argument, 2 provided
Build failed for project 'UCGLib_test'
neu-rah commented 7 years ago

Hi!

I was able to go a bit further with the following includes

#include <SPI.h>
#include <Ucglib.h>
#include <menu.h>
#include <menuIO/UCGLibOut.h>
#include <menuIO/chainStream.h>
#include <ClickEncoder.h>
#include <menuIO/clickEncoderIn.h>
#include <menuIO/serialOut.h>

note: somehow ClickEncoder is defined to be included only on some avrs, probably causing problem with some other mcu, however i know it works with teensy. here fixing the problem by including ClickEncoder.h before menuIO/clickEncoderIn.h

your code was also missing #include <menuIO/serialOut.h>

however still have some ucglib errors...

Triscus commented 7 years ago

Ah ok, I already tried changing the orders, but had no luck. I added the interrupt stuff for the encoder and now it's working like charm.

Thank you very much for the support