I decided to build on the temperature example by adding an external sensor to the RFduino. In keeping with the temperature theme I used a TMP007 temperature sensor from Adafruit.
To read the temperature from the TMP007 I used the TMP007 library from Adafruit.
Remember when installing libraries to use with the RFduino you need to get them put in the right place in the Arduino tree. On my system this directory is located at C:\Program Files (x86)\arduino-1.5.7\hardware\arduino\RFduino\libraries. On your system this will be dependent on where your Arduino IDE with RFduino support is located.
The files for the TMP007 demo are here on GitHub in the dhRFduino repository.
The hardware setup for this demo is very simple. The TMP007 and the RFduino are connected to power and ground and the SCL and SDA lines on the TMP007 are connected to SCL labeled GPIO5 and SDA labeled GPIO6 on the RFduino.
If this demo is run in DEBUG mode and the serial console is attached to the RFduino status messages will be logged when a connection is made to the RFduino, when the connection is disconnected, the temperature each time the sensor is red and when a new temperature value is detected.
No comments:
Post a Comment