Hi:) I am using the metro microcontroller with the Adafruit STEMMA Soil Sensor. There are two values coming in and I want to send them only if there is a change.
My error is:
In function 'void loop()':
soilsensor_BOTH_CHANGESonly:23:13: error: expected ')' before '!' token
if (tempC ! = old_tempC);
^
soilsensor_BOTH_CHANGESonly:29:19: error: expected ')' before '!' token
if (capread ! = old_capread);
^
Multiple libraries were found for "Wire.h"
Used: /Users/bal/Library/Arduino15/packages/adafruit/hardware/avr/1.4.13/libraries/Wire
Not used: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire
Using library Adafruit_seesaw_Library at version 1.3.1 in folder: /Users/bal/Documents/Arduino/libraries/Adafruit_seesaw_Library
Using library Wire at version 1.0 in folder: /Users/bal/Library/Arduino15/packages/adafruit/hardware/avr/1.4.13/libraries/Wire
exit status 1
expected ')' before '!' token
Any advice would be appreciated as I am a newbie. I read related posts but I am still not sure what is wrong. My code is:
#include "Adafruit_seesaw.h"
Adafruit_seesaw ss;
void setup() {
Serial.begin(9600); //initialize serial communication BAUDRATE 115200
if (!ss.begin(0x36)) {
Serial.println("ERROR! seesaw not found");
while(1);
} else {
Serial.println();
Serial.print("seesaw started! version: ");
Serial.println(ss.getVersion(), HEX);
}
}
int old_tempC;
int old_capread;
void loop() {
float tempC = ss.getTemp();
if (tempC ! = old_tempC);
Serial.print(tempC);
old_tempC = tempC;
delay(1);
uint16_t capread = ss.touchRead(0);
if (capread ! = old_capread);
Serial.println(capread);
old_capread = capread;
delay(1000);
}