CrossRoads:
Take a look at the map() and constrain() functions.
map() - Arduino Reference
Thanks for your help. I have tried using the below code
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor
This example code is in the public domain.
*/
void setup() {
Serial.begin(9600);
}
void loop() {
int val = analogRead(0);
val = map(val, 0, 1023, 0.0, 14.0);
Serial.println(val);
}
I am trying to get it to use one decimal place i.e if it is on 0 then it would real 0.0 if it is half way across then it would read 7.0 I would like the second decimal place rounded off so if it reads 8.16 then it would read 8.2 if it where to read 10.5 then it would read 10.0 etc
The above is working fine but it only reads 1,2,3,4,5,6,7,8,9,10,11,12,12,14 without the decimal place
Thanks