Let's Make Robots!
avoids obstacles using a sharp ir sensor
Using a
After reading on LMR for a while and drawing inspiration and reading about loads of tips and tricks i thought i should share my first creation. It is not finished … Read more

converting values. arduino #solved#

So here is the question in short.

Im using a arduino uno and have analog readings filtered to 0 to 50, i want to convert those values to 50 to 0 insted.

This is probably realy simple but my head is blank.

more detailed description is that i want to take the distance reading and make a speaker bep more frequently the closer the robot comes to something, brings back old videogame memmories.

A spekar is hooked up to digitalpin 3 and i have some code that beeps but i get stuck at making the beeps more frequent and  not longer...