Hi, Ytai!!

Yesterday, I fix the problem. I'm using the following code, that can be see 
below:

Ps.: I find out that this "ACTION DOWN AND UP" can be to used when I 
pressed the button ---action down and when i release the button ----action 
UP.
I hope to help from this code.

button1.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
 // show interest in events resulting from ACTION_DOWN
 while (event.getAction()==MotionEvent.ACTION_DOWN) return true;
 {
 
 
 try {
 
pwmsinal=(float) (pwmsinal+0.03);
pwm.setDutyCycle((float) pwmsinal);
  } catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
 }
 }
 if(event.getAction()!=MotionEvent.ACTION_UP) return false;
 try {
pwm.setDutyCycle((float) 0);
pwmsinal=0;
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}                 
 return true;
}
});   

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to