I am fairly new to this, but got hooked to try and experiment with the arduino, and now I am stuck in a small project.
I am trying to hook up a sensor to a gauge.
I measured the sensor, and it goes from 1023 to 200, on the analog in pin. 1023 is empty and 200 is full.
This I want to remap (or how it is done) to 175 to 20 on the digital pin. 175 is empty on the gauge and 20 is full. This I measured in the 0 till 255 range.
Is there someone out here that can help me write this sketch? I tried and tried but without succes.
If you have read the data from the sensor and checked the output values to drive the gauge you obviously do have some working code. So post your best attempt at putting both things together (read "How to use this forum" first and follow the instructions). Then we'll gladly help you to sort it out.
You're using the same variable name for the output pin number and the mapped output value. Then you're doing an analogWrite to a pin number that you've set to 175-20. That's not going to work.