It seems that you need to add #pragma once
at the top of u8g2/U8g2LinuxI2C.h
O2O question
Remork enum Error error = kOk;
Don't make this global, rather have it inside each handler function.
will try all that tomorrow.
thanks so much already!
alright!
had some issues with displayHeight
- not having that in handleProject.cpp
caused an undefined variable error, and if i did put it in it caused a multiple definitions error.
shouldn't the 'multiple definitions' mean that it could already see it in the first place, and that it should work fine without having it in? seems contradictory, but i'm sure i'll get my head around that one day
anyway, moving the def back inside the parsing function in main.cpp
smooths that out, and now at least it is compiled and running. HOORAY!
still, no smooth sailing yet: if i send a bang from local.pd, as in
bang
|
oscformat project0 test
i get both the notification that it got and matched the message, AND an error:
Message from 192.168.7.1:37358
received /project0/test
An error occurred with message to: /project0/test: unexpected types and/or length
i can only assume the "received" is coming from the function inside handleProject0.cpp?
which should cause a message on screen to appear. which it doesn't.
if i send a float instead of a bang (just testing) i only get the error.
- Edited
ok. recompiled and now it's behaving.
weird one that!
will try to run a couple of times to see if it was a one off.
then start to move code around and see how it goes.
excited! thank you so much for your time!
Remork it seems to be doing both the if and elseparts:
I need to see the full function.
Remork shouldn't the 'multiple definitions' mean that it could already see it in the first place, and that it should work fine without having it in?
It's the difference between seeing it at compile time (where it looks at one cpp file and its includes at a time to build an object file) and at link time (where it links all objects together). For it not to fail at compile time it needs a global declaration: in one file you define the variable, e.g.: int displayWidth = 64;
, in the others you declare it with extern
, e.g. ; extern int displayWidth;
then it knows the symbol exists somewhere (not in the current file) and will not try to define a new one. Anyhow, the best thing is probably not to use any globals at all and just get the screen size locally in the handler:
int displayWidth = u8g2.getDisplayWidth();
int displayHeight = u8g2.getDisplayHeight();
ok, that makes sense. yes yes yes. thanks!
ironing out the rough spots in the O2O code i had for one of the Pepper patches, but it would seem i'm up and running. which is amazing!