Start a new topic

Question about the CompButton example

Hello , 

why i need the parameter "&b0" in

b0.attachPop(b0PopCallback, &b0); 

it s also work without &b0.


Dear Dominik Loher:

As you see the function prototype is  " void attachPop(NexTouchEventCb pop, void *ptr = NULL)"  

So  "&b0" is  just an input paramter which is passed to the "b0PopCallback" function. 

If you do not need any paramter in your user-defined callback function ,you can just pass a  "NULL"  to it. 

I have another question :
I changed the formula to multiply the number by negative 1 :
number *= -1;
So the number goes from 1 to -1 and visa versa , I then used this value ti switch the LED
on my UNO :
    if (number == 1)
    digitalWrite(13, HIGH);
    digitalWrite(13, LOW);

My question is this : How do I get it to display ON and OFF instead of 1 or -1 ?


Login or Signup to post a comment