Week 6 Physical Computing Lab
Lab: Asynchronous Serial Communications
Preparing the Board
ASCII vs. Binary
ASCII-encoded decimal number
Mapped output to a range from 0 - 255
Sending Data in Multiple Formats
Formatted output, printing raw binary value, then the ASCII-encoded binary value, then the ASCII-encoded decimal, hexadecimal, and octal values.
Changing Serial.println() to Serial.write() sends out binary value of the sensor readings.
Values from Sensors
Formatting multiple serial data using punctuation
Sending values for all three sensors
Using the same concept, formatted data from two analog sensors and one digital switch
Flow Control
Using Terminal’s screen
Using Arduino’s Serial Monitor
Lab: Serial Input to P5.js
Preparing the Board
Establishing connection using P5.js Serialport Library
Using Serial Event
Drawing Graphs with Sensor Values
Lab: Serial Output from P5.js
Preparing the Board
Serial Communication with Numeric Data
Controlling LED with key press 0 through 9
Controlling LED with Mouse Drag
Serial Communication with ASCII-Encoded data
Controlling LED with capital H and L