![]() The onewire library is also available at the pycom-libraries GitHub. DallasTemperature sensors ( & oneWire ) /* * The setup function. This tutorial explains how to connect and read data from a DS18x20 temperature sensor. Then, the module’s GND is connected to one of the Arduino’s GND pins. First, we connect the module’s VCC to the Arduino’s 5V pin. In this tutorial we will make use only of the first four pins: VCC, GND, SDA, and SCL. Include the libraries we need #include #include // Data wire is plugged into port 2 on the Arduino #define ONE_WIRE_BUS 2 // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) OneWire oneWire ( ONE_WIRE_BUS ) // Pass our oneWire reference to Dallas Temperature. Fritzing file that shows how to wire the GY-521 breakout board to an Arduino Uno.
0 Comments
Leave a Reply. |