Hardware Reference
In-Depth Information
Verifying the Code
With everything set up and loaded onto the respective Arduinos, plug the reader into the USB and start the serial
monitor. Consecutive numbers should print to the screen, counting up, and the simulated sensor's LED should blink
when the master sends specific commands. Using direct register manipulation to replicate sensors allows maximum
control of the I2C interface that the library does not currently allow.
Note
Chapter 10 on multi processing, covers methods of Spi communication that can be applied for sensor simulation.
Summary
The techniques described in this chapter are not limited to sensors, and can be applied to other systems that move
data from one component to another. This chapter focused on the connection of the sensor to the Arduino, because
that is the most difficult hurdle in simulating sensors.
When writing code to simulate sensors, work slowly and tackle one part of the sensor at a time to avoid
complications. Also take the time to practice writing code to simulate sensors that are readily available for verification
against the code you created.
 
 
Search WWH ::




Custom Search