Chapter 1. Bringing JavaScript and hardware together
Figure 1.1. Oh, the magical things in our world!
Figure 1.2. The automatic fan system needs to take input from a temperature sensor and manage the output of a motorized fan.
Figure 1.3. The automatic fan needs a brain. A popular option is a microcontroller, which combines a processor, memory, and I/O capabilities in a single package.
Figure 1.4. A rough schematic drawing showing how the fan’s inputs, outputs, and microcontroller are connected in a system with power and circuitry. Don’t stress out if the symbols are new to you—you’ll be learning about circuitry as we continue our journey.
Figure 1.5. Microcontroller-based development boards make it more convenient to connect input and output devices.
Figure 1.6. A breadboard provides an electrically connected grid on which to prototype electronic circuits.
Figure 1.7. Non-volatile program memory (EEPROM and Flash) and user-friendly boards have made it easier to program microcontrollers with firmware.
Figure 1.8. The completed, packaged, automatic fan is an example of an embedded system. Inputs and outputs are processed by a microcontroller-based microcomputer and supported by power and circuitry. And the whole thing is hidden inside a pretty fancy box, because, why not?
Figure 1.9. The host-client method of controlling hardware with JavaScript
Figure 1.10. For host computer and client hardware to communicate in this method, they both need to use a common API.