iona
iona copied to clipboard
NanoSenseClientSupportingDaisyChain broken?
Hi,
i tried to link 2 nano to enable multiple nodes . I replaced NanoSenseClient NanoSenseClientSupportingDaisyChain in main code this way:
#if defined(USE_NANO) NanoDataClient data; NanoSenseClientSupportingDaisyChain sense; //using daisyChain sense client //NanoSenseClient sense; //original NanoLedClient led;
when compiling it comes with this error:
In file included from C:\arduino_projects\iona\jvsio\clients\NanoClient.h:12:0, from C:\arduino_projects\iona\iona.ino:10: C:\arduino_projects\iona\jvsio\clients\BaseClient.h: In instantiation of 'void BaseSenseClientSupportingDaisyChain<PORT, TCCRA_VAL, TCCRA_FLIP, OCRA_VAL, SENSE>::begin() [with int PORT = 3; int TCCRA_VAL = 18; int TCCRA_FLIP = 16; int OCRA_VAL = 1; int SENSE = 19]': C:\arduino_projects\iona\iona.ino:271:1: required from here C:\arduino_projects\iona\jvsio\clients\BaseClient.h:144:66: error: 'void BaseSenseClient<PORT, TCCRA_VAL, TCCRA_FLIP, OCRA_VAL>::begin() [with int PORT = 3; int TCCRA_VAL = 18; int TCCRA_FLIP = 16; int OCRA_VAL = 1]' is private within this context BaseSenseClient<PORT, TCCRA_VAL, TCCRA_FLIP, OCRA_VAL>::begin(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ C:\arduino_projects\iona\jvsio\clients\BaseClient.h:114:8: note: declared private here void begin() override { ^~~~~ exit status 1
Am I doing it wrong or is the code broken?
Best regards, Mike
Ok, found what was broken since begin method was declared private into BaseSenseClient , it couldn't be used by DaisyChain client, changed it t protected solved the problem.
template <int PORT, int TCCRA_VAL, int TCCRA_FLIP, int OCRA_VAL> class BaseSenseClient : public JVSIO::SenseClient { protected: //former private void begin() override {
Now i need to test node linking. I'll keep you updated with this!
Just did some tests with two board linked on TTX3. First board in the chain isn't recognized and second is seen as 1 player but controls work . Any idea on how this could happen? Or any adivse on how to test nodes? Best regards,