Pauses a program for the amount of time as specified in milliseconds, where 1000 equals 1 second.
delay(1000); // waits for one second
Returns the number of milliseconds since the Arduino board began running the current program as an unsigned long value.
value = millis(); // sets ‘value’ equal to millis()
Note: This number will overflow (reset back to zero), after approximately 9 hours.
This function is used to change covert a value in particular range to other range. for example if we read a value from analogport A0 is 25, its betwwena range of 0-1023 in oder to cover value of analog port A0 to range of 0-255 we use map function
map(value, fromLow, fromHigh, toLow, toHigh) // example analogValue = map(analogValue, 0, 1023, 0, 255);
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