Page 1 of 1

Touch Wheel Phidget only button 0 working

Posted: Wed Jul 17, 2019 9:13 am
by alistair.monaghan
I've downloaded the Javascript resource for CapacitiveTouch but it only seems to work for the 0 touch button and not the scroll wheel?

There is an option to view the axisField and axisDial so it must be possible - anyone know where I'm going wrong...or have a working example?

Re: Touch Wheel Phidget only button 0 working

Posted: Wed Jul 17, 2019 9:28 am
by jdecoux
The scroll wheel is on channel 4 for the HIN1001, though the example will connect to channel 0 by default.

If you set the channel to 4 before opening it, the scroll wheel will be attached.

Code: Select all

var ch = new phidget22.CapacitiveTouch();

ch.setChannel(4);

//Set up event handlers and other addressing here

ch.open(5000);

Re: Touch Wheel Phidget only button 0 working

Posted: Wed Jul 17, 2019 9:35 am
by alistair.monaghan
Of course! i was so close, many thanks.

Re: Touch Wheel Phidget only button 0 working

Posted: Thu Jul 18, 2019 3:00 am
by alistair.monaghan
ok, thanks again, just following on from this...is there a way to stop the axisDial value at 1 and 0? i.e. it doesn't loop?

Re: Touch Wheel Phidget only button 0 working

Posted: Thu Jul 18, 2019 8:19 am
by mparadis
You need to handle this special case in your code. In the change handler for the scroll wheel, compare the incoming value with the previous value and ignore it if the change is too large (0.8 or more maybe?). This should cause the scrolling to stop when you hit the seam.