Arduino Prog
Arduino Prog
https://www.youtube.com/watch?v=9uHZB7-T_XA&list=PLGs0VKk2DiYw-L-RibttcvK-
WBZm8WLEP&index=2
millis()
digitalRead(pin_number) >> buttonState ---> int
INPUT_PULLUP
Serial.read() :: returns the first bytes of serial data available for reading if
not return -1.
First check if data is available for reading in the received buffer if yes then
read it using .read() function.
Arduino Serial find and findUntil Function reads the received buffer and test for
specified string or word present or not.
If specified string is present in the buffer than the function return the true,
otherwise return false.
By default the findUntil function wait for terminating character before it return
false.
The Serial.findUntil() function wait for one second or timeout time, but findUntil
function return false immediately as soon as it receive the terminating character.
Example: isOKFound = Serial.findUntil("OK", "x"); // terminating character is 'x'
You can consider the terminating character as command end symbol, like in c
language compiler look for “;” for end of statement.
This function is use to see whether any integer or floating point input is
available in the BUFFER. "I ate 314 tomatos" input is ready in the buffer then
Serial.parseInt() --> return 314, strip off --> "I ate"
buffer remain with --> " tomatoes". Same goes to .parseFloat() function.
Serial.readStringUntil(terminator)
delay(millisecs)
delayMicroseconds(millisecs)
millis() :: start of the arduino board
micros() ::
digitalWrite(pin,INPUT/OUTPUT)
analogWrite(pin, value) :: 0 to 255 --> value
random()
randomSeed(seed)