I'm not sure if I am heading in the right direction with the map function, but...
I read an analog to digital converter. It returns a value from 0-255. I am trying to use the map function to map that AD number to 0-360. It is a Davis wind vane. For example, a reading of 127.2 should return a 180.
Some guidance please?
>>> vane=127.2
>>> direction = map(vane,0,255,0,36)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>>