Weitere Kapitel dieses Buchs durch Wischen aufrufen
You’ve seen a lot of examples of powering LEDs—turning them on and off from our IoT device. There are a lot of interesting things you can do with LEDs. For example, have you wondered how a power meter works? If you have used high-end audio equipment, such as a studio sound board, you may have seen a power meter that has several segments ranging from green to yellow to red where green means the level is low, yellow is medium, and red is high. You can duplicate this behavior with a set of LEDs and your IoT device. Yes, you’re going to build a fancy LED power meter!
Bitte loggen Sie sich ein, um Zugang zu diesem Inhalt zu erhalten
Sie möchten Zugang zu diesem Inhalt erhalten? Dann informieren Sie sich jetzt über unsere Produkte:
And here’s another one!
For more information about SPI, see https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus.
There are other ways to do this, but this uses a technique we’ve seen previously.
You don’t have to name it InitGPIO(), but that is the common theme. Actually, any reasonable name is fine; but if you are going to share your code, InitGPIO() is a good name.
For mode explanations, see www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/.
- Project 1: Building an LED Power Meter
- Chapter 10