Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9880 Discussions

MRAA Range Mapping

COkon
New Contributor I
1,297 Views

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
1 Solution
Diego_V_Intel
Employee
167 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
Diego_V_Intel
Employee
168 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.

COkon
New Contributor I
167 Views

Thank you DiegoV_intel,

I really appreciate it. It worked

Reply