Touch Wheel Phidget only button 0 working

Supporting Browser-based Javascript and Node.js
Post Reply
alistair.monaghan
Phidgetsian
Posts: 9
Joined: Tue Mar 05, 2019 3:36 am
Contact:

Touch Wheel Phidget only button 0 working

Post 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?
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Touch Wheel Phidget only button 0 working

Post 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);
alistair.monaghan
Phidgetsian
Posts: 9
Joined: Tue Mar 05, 2019 3:36 am
Contact:

Re: Touch Wheel Phidget only button 0 working

Post by alistair.monaghan »

Of course! i was so close, many thanks.
alistair.monaghan
Phidgetsian
Posts: 9
Joined: Tue Mar 05, 2019 3:36 am
Contact:

Re: Touch Wheel Phidget only button 0 working

Post 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?
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Touch Wheel Phidget only button 0 working

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests