Library to use the wii nunchuk distributed by Nintendo
Diff: Nunchuk.cpp
- Revision:
- 2:0a8f43931041
- Parent:
- 0:37e9a0644485
--- a/Nunchuk.cpp Sun Nov 17 13:35:01 2013 +0000 +++ b/Nunchuk.cpp Tue Feb 25 10:50:05 2014 +0000 @@ -14,16 +14,18 @@ this->btnZ=false; setup(); - - myTicker.attach(this,&Nunchuk::action,periodeTe); + + if(periodeTe>0) + myTicker.attach(this,&Nunchuk::process,periodeTe); } //----------------------- Nunchuk::~Nunchuk(void) { + if(periodeTe>0) myTicker.detach(); } //----------------------- -void Nunchuk::action(void) +void Nunchuk::process(void) { bool res=false; static char datas[6];