fortudiego / funnel

Automatically exported from code.google.com/p/funnel
Other
0 stars 0 forks source link

bug in Potentiometer.as #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
in the Potentiometer.as class, line 43 is incorrect. 

Please change:

 _value = e.target.number; 

to:

 _value = e.target.value;

Original issue reported on code.google.com by jeff.ho...@gmail.com on 30 Jan 2011 at 8:20

GoogleCodeExporter commented 8 years ago
regarding the Potentiometer.as class, since analog pins already return a value 
between 0 and 1.0 (assuming that the user has set the voltage reference on the 
arduino if necessary), it may be better to allow the user to set their desired 
output range. So in this case the function of setRange(minimum:Number, 
maximum:Number) may be better expressed as allowing the user to enter their 
desired minimum and maximum output. So the following (line 39) would change 
from:

_pin.filters = [new Scaler(minimum, maximum, 0, 1, Scaler.LINEAR)];

to:

_pin.filters = [new Scaler(0, 1, minimum, maximum, Scaler.LINEAR)];

because the analog pin already returns a value from 0 to 1.0.

Original comment by jeff.ho...@gmail.com on 30 Jan 2011 at 8:26