Building an Arduino Pest Repeller on Linux (Part 2)
May 02, 2014, 09:00 (0 Talkback[s])
(Other stories by Carla Schroder)
How to Help Your Business Become an AI Early Adopter
An Arduino sketch contains two required functions: setup() and loop(). setup() contains code that you want to run once at the beginning of your sketch, such as pin modes and initializing hardware. In our
ez1_measure.ino sketch we set our data transmission speed in setup(). We are setting a serial port speed even though our Arduino is connected with a USB cable because it is still a serial port, a proper UART (Universal Asynchronous Receiver/Transmitter), and it supports the standard serial port speeds: 300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200 baud. And that is why the Arduino IDE has a serial monitor where we can watch the output of our sketches.