Professional Documents
Culture Documents
Introduction to Engineering
• Serial.write(): Writes binary data to the serial port. This data is sent as a
byte or series of bytes
• Syntax: Serial.write(val)
• Example: Serial.wrtie(”Hello world“) writes "Hello world“
Note: Sketch must be loaded first; else, Serial Monitor will close on Sketch upload
OR
ANALOG SIGNALS
▪ Analog signal is any continuous signal Vs. time!
▪ digital signal uses discrete (discontinuous) values
5V
0V
5V
0V
Analog Sensors
• Syntax: analogRead(pin)
Digital signal
depends on the
resolution of the
analog-to-digital
converter (ADC).
A 10-bit system will
have 1,024 points of
resolution.
210 = 1,024 Why the number 2?
Because there are two options in a binary system (0 & 1).
Analog to digital conversion
0 255
potentiometer
Circuit #2: Potentiometer
How to read analog input from the
physical world using a potentiometer
(“pot” for short) and control the blink rate
of an LED. We’ll also learn how to use the
serial monitor to watch how the voltage
changes.
We’re adding a
potentiometer to
control the blink rate of
the LED.
Vin
Vin