Chapter 12 Logging with Serial - Method 6
Method 6 is another "automatic" way to log data from your microcontroller. This method uses the serial library in Python to read data sent from your CircuitPlayground Express or Bluefruit. The idea is to have the Circuit Playground send data via USB to your laptop just like the REPL in Mu but instead of just viewing the output in Mu a Python script on a laptop can read and process the data. Serial communication is a fundamental method for microcontrollers to send data to a computer. In this chapter, we will explore how to use the serial library in Python to read data from your CircuitPlayground Express or Bluefruit. This method allows you to log data in real-time and can be a powerful tool for data acquisition and analysis. The code on the CPX/CPB is the same button press code used for the last few chapters and again can be found on Github. The code itself is discussed in detail in Chapter ChapterΒ 9.
