# Questions tagged [map]

The tag has no usage guidance.

13 questions
Filter by
Sorted by
Tagged with
32 views

Mega 2560 I am reading in values from 3 pots then mapping them to values between 0 - 255 #define REDPIN 7 #define GREENPIN 8 #define BLUEPIN 9 int red_pot = A0; // analog pin used to connect ...
17 views

### Use joypad to control a robotic arm with 8 servos

I'm using Arduino UNO and the SSC-32U board to control a robotic arm made up by 8 digital servos. At the moment, I'm correctly able to move each servo by using the following code: move1(servo_pin, ...
32 views

### How to map integer values and round to a count of tens/thousands?

I'm mapping a potentiometer from 0-1023 to 1000-120000 (1 sec to 2 minutes) for a timer, like: maxDelay = map (pot2, 0, 1023, 1000, 120000); Both variables are integers. Now I would like to convert/...
358 views

I am investigating the use of a 3-position-switch for one of my projects to switch between different settings using just one analog input pin. For the three positions I am using ground/0V, ~2.5V (via ...
415 views

### Arduino std::map returning random values

I'm working with an arduino UNO. I would like to be able to send it set and get commands over serial and have it update class data class members accordingly by key value pair. I spoke to users in the ...
165 views

### What is the definition of these arduino commands, and how do they affect the circuit? [closed]

I don't know if I am allowed to ask this question because really I could just look this up on google. The reason I'm asking here is because in google when you look up the definitions for the following ...
4k views

### Explanation of the formula of the map funtion

Can someone please explain (mathematically) how the formula for the map function actually came to light? I have given the code of the map function below. You can see that it uses a formula to "map" ...
7k views

### Why is the constrain function used after the map function?

I am reading some sample code and they use this method of mapping data from IR sensors: sensor1 = analogRead(0); adj_1 = map(sensor1, s1_min, s1_max, 0, 255); adj_1 = constrain(adj_1, 0, 255); ...
826 views

### Does the map() function works on an ATtiny85?

I have a working project on Arduino Uno.Now I want to shrink my project using an ATtiny85. Before purchasing an waiting for the shipment to arrive, I want to make sure that my whole code will run on ...
1k views

### Fade LED strip using proximity and map() function

I'm using a sonar sensor to detect proximity, and need to control the brightness of an LED strip in direct relationship to the distance detected. For example, as someone moves toward the sonar, the ...
1k views

### Arduino starter kit servo is shaking

In the example of the arduino starter kit the point is to use a potenciometer to control a servo. The code is angle = map(potVal, 0, 1023, 0, 179); The output in the serial potVal: 1023, angle: ...