Summary

Chapter 3 introduced many new commands and concepts in programming. You've learned about arrays and how to use them, how to read analog values from a pin, how to use PWM pins, and the basics of serial communications. Knowing how to send and read data across a serial line means you can use your Arduino to communicate with all kinds of serial devices and other devices with simple communication protocols. You will revisit serial communications later in this book.


Subjects and concepts covered in Chapter 3:

  • Arrays and how to use them
  • What a potentiometer (or variable resistor) is and how to use it
  • Reading voltage values from an analog input pin
  • How to use the mathematical sine (sin) function
  • Converting degrees to radians
  • The concept of casting a variable to a different type
  • Pulse Width Modulation (PWM) and how to use it with analogWrite()
  • Creating colored lights using different RGB values
  • Generating random numbers using random() and randomSeed()
  • How various lighting effects can be generated with the same circuit but different code
  • The concept of serial communications
  • Setting the serial baud rate using Serial.begin()
  • Sending commands using the Serial Monitor
  • Using an array to create text strings
  • Flushing the serial buffer using Serial.flush
  • Checking if data is sent over the serial line using Serial.available
  • Creating a loop while a condition is met with the while() command
  • Reading data from the serial line using Serial.read()
  • The basic concept of pointers
  • Sending data to the Serial Monitor using Serial.print() or Serial.println()
  • Manipulating text strings using the strtok() function
  • Converting a string to a long integer using strtol()
  • Constraining a variables value using the constrain() function
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.100.255