I am trying to attach a temperature sensor to my particle electron and am having errors with the libraries. On arduino, I was able to use Adafruit_MCP9808.h as a library but that didn’t work for particle electron. Then I tried to just use MCP9808.h as a library and reports it as no file or directory when it clearly states that the library has been attached.
Below is what I am seeing on my screen. Thank you
Make sure you’ve upgraded your Electron to system firmware 0.6.0 or later. The current version is 0.7.0.
Many libraries don’t work properly with older versions of system firmware, including the factory default 0.5.3. And the error message makes no sense.
I am using the online particle build software. Does that need to be updated? If so how can I do that?
When Rick talks about system firmware version he doesn’t mean the version of the development tool but what version you have selected in Web IDE to build your firmware for.
See in the docs
https://docs.particle.io/guide/getting-started/build/photon/#flashing-your-first-app
1 Like
you could just use this sample code
// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// MCP9808
// This code is designed to work with the MCP9808_I2CS I2C Mini Module available from ControlEverything.com.
// https://www.controleverything.com/content/Temperature?sku=MCP9808_I2CS#tabs-0-product_tabset-2
#include <application.h>
#include <spark_wiring_i2c.h>
// MCP9808 I2C address is 0x18(24)
#define Addr 0x18
double cTemp = 0.0, fTemp = 0.0;
void setup()
{
// Set variable
Particle.variable("i2cdevice", "MCP9808");
Particle.variable("cTemp", cTemp);
// Initialise I2C communication as MASTER
This file has been truncated. show original