Arduino Measurement Projects for Beginners: Arduino Programming basics and Get started guide by Simone bales

Arduino Measurement Projects for Beginners: Arduino Programming basics and Get started guide by Simone bales

Author:Simone bales [bales, Simone]
Language: eng
Format: epub
Published: 2018-10-19T07:00:00+00:00


map()

This function is used to change covert a value in a particular range to other range. for example, if we read a value from analog port A0 is 25, its between a range of 0-1023 in order to cover the value of analog port A0 to a range of 0-255 we use the map function

map(value, fromLow, fromHigh, toLow, toHigh)

// example

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

random()

The random() function returns a semi-random number up to the parameters specified. If no parameters are specified, it will return a value in the signed long data type, with a range of -2,147,483,648 to 2,147,483,647. Its syntax follows:

random(min, max) // "min" minimum possible value expected from the random()

// "max" maximum value expected from the random()

function



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.