Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Contributor I
1,168 Views

MRAA Range Mapping

Jump to solution

How do I achieve this in MRAA

/* Map an analog value to 8 bits (0 to 255) */

void setup() {}

void loop()

{

int val = analogRead(0);

val = map(val, 0, 1023, 0, 255);

analogWrite(9,<span style="color: # 000000; font-family: 'TyponineSans Monospace Regular 4'; font-size: 14px; background-color: # e...

0 Kudos

Accepted Solutions
Employee
38 Views

Hello dunex_1,

You could write your own version of the map() function. It is easy to implement. Please check the following site where it is explained (check the Appendix section): https://www.arduino.cc/en/Reference/Map Arduino - Map

Regards,

Diego.

View solution in original post

2 Replies
Employee
39 Views

Hello dunex_1,

You could write your own version of the map() function. It is easy to implement. Please check the following site where it is explained (check the Appendix section): https://www.arduino.cc/en/Reference/Map Arduino - Map

Regards,

Diego.

View solution in original post

New Contributor I
38 Views

Thank you DiegoV_intel,

I really appreciate it. It worked