Storing Arduino data in a CSV file

In the previous two sections, you learned methods to store values in a CSV file. Although the data required for the file was already initialized in the code, the same code could be modified to store Arduino input data.

To begin with storing Arduino data, let's create a circuit that produces these values for us. We used a motion sensor in the project of Chapter 3, The First Project – Motion-triggered LEDs, and a potentiometer in the exercise of Chapter 4, Diving into Python-Arduino Prototyping. We will be using these two sensors to provide us with digital and analog input values respectively. To develop the circuit required for this exercise, connect the potentiometer to the analog pin 0 and the PIR motion sensor ...

Get Python Programming for Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.