Formatting Input Data
Huge Demux
Posts: 5
Hi!
I would like to know the best way to format a sensor's input that starts at 255 and goes down to 0.
First I want to reverse it so that it starts from 0 and goes up to 255. Then I'd divide the result by 2 to get a 0 -127 range.
So how do you use Pbasic to reverse a range of numbers?
Demux
I would like to know the best way to format a sensor's input that starts at 255 and goes down to 0.
First I want to reverse it so that it starts from 0 and goes up to 255. Then I'd divide the result by 2 to get a 0 -127 range.
So how do you use Pbasic to reverse a range of numbers?
Demux
Comments
Have you tried: value=(255-sensor_reading/2 ??
Klaus