Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Arduino Help
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino Help

by MARKSSSS on Fri Feb 28, 2020 2:23 pm

Hello, We are unexperienced with arduino. Connecting it to a sparkfun red board. Getting this error,

In file included from C:\Users\sandy\OneDrive\Documents\Arduino\serialthermocouple_2\serialthermocouple_2.ino:18:0:

C:\Users\sandy\OneDrive\Documents\Arduino\libraries\Adafruit_MAX31855_library/Adafruit_MAX31855.h:49:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]

Adafruit_SPIDevice spi_dev = NULL;

^~~~

In file included from C:\Users\sandy\OneDrive\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.cpp:36:0:

C:\Users\sandy\OneDrive\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.h:49:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]

Adafruit_SPIDevice spi_dev = NULL;

^~~~

Thanks

MARKSSSS
 
Posts: 1
Joined: Fri Feb 28, 2020 2:19 pm

Re: Arduino Help

by kcl1s on Fri Feb 28, 2020 3:51 pm

Posting the code that is giving the error would help. Please use the code button above the edit window and put code between tags.

Fellow hobbyist
Keith

kcl1s
 
Posts: 1511
Joined: Tue Aug 30, 2016 12:06 pm

Re: Arduino Help

by nsdev on Wed Mar 04, 2020 1:59 am

Hi We are having the same issue, we are using the sample code provided with the MAX31855 library.

Code: Select all | TOGGLE FULL SIZE
/***************************************************
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to
  interface
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <SPI.h>
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   3
#define MAXCS   4
#define MAXCLK  5

// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

void setup() {
  Serial.begin(9600);

  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = ");
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFahrenheit());

   delay(1000);
}

nsdev
 
Posts: 1
Joined: Wed Mar 04, 2020 1:57 am

Re: Arduino Help

by trentonmarshall on Sun Mar 15, 2020 2:45 am

Hey,

I'm getting the same error:

Code: Select all | TOGGLE FULL SIZE
In file included from C:\My\Doc\Path\sketch\serialthermocouple.ino:18:0:

D:\Documents\Arduino\libraries\Adafruit_MAX31855_library/Adafruit_MAX31855.h:49:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]

   Adafruit_SPIDevice spi_dev = NULL;

                                ^~~~


Here's the class in the other file that is causing the error:

Code: Select all | TOGGLE FULL SIZE
class Adafruit_MAX31855 {
public:
  Adafruit_MAX31855(int8_t _sclk, int8_t _cs, int8_t _miso);
  Adafruit_MAX31855(int8_t _cs);

  void begin(void);
  double readInternal(void);
  double readCelsius(void);
  double readFahrenheit(void);
  uint8_t readError();

private:
  Adafruit_SPIDevice spi_dev = NULL;
  boolean initialized;

  uint32_t spiread32(void);
};

trentonmarshall
 
Posts: 2
Joined: Sun Mar 15, 2020 2:42 am

Re: Arduino Help

by adafruit_support_carter on Mon Mar 16, 2020 1:19 pm

I just did some test compiles for various targets and could not recreate this issue. Can you provide more info:

Arduino IDE Version = ?
Target Board = ?
Target Board BSP Version = ?
MAX31855 Library Version = ?

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino Help

by trentonmarshall on Sun Mar 22, 2020 10:03 am

adafruit_support_carter wrote:I just did some test compiles for various targets and could not recreate this issue. Can you provide more info:

Arduino IDE Version = ?
Target Board = ?
Target Board BSP Version = ?
MAX31855 Library Version = ?


I've been trying the serialthermocouple example with that error. I tried the lcdthermocouple example and that seemed to work with no errors. I noticed the Wire.h library was included on that one. I included it on the serialthermocouple example and now it seems to be working fine. Is this something that it should work without anyways or is Wire.h necessary?

trentonmarshall
 
Posts: 2
Joined: Sun Mar 15, 2020 2:42 am

Re: Arduino Help

by adafruit_support_carter on Mon Mar 23, 2020 12:15 pm

I've been trying the serialthermocouple example with that error.

That's the same example I tested above and got no errors.

Arduino IDE Version = ?
Target Board = ?
Target Board BSP Version = ?
MAX31855 Library Version = ?

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino Help

by alainsam on Thu Apr 02, 2020 7:47 pm

Hi
I have the same issue with the Max31855:
Windows10
Arduino IDE Version = 1.8.12
Target Board = UNO
Target Board BSP Version = R3
MAX31855 Library Version = 1.1.1 I also tried the last version with the same result

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Re: Arduino Help

by alainsam on Fri Apr 03, 2020 12:27 am

I tried these IDE version 1.812 1.8.10 1.8.8 and 1.6.13 with the same problem.
But with the online arduino Create it works!....
I still need to use the IDE on my computer and need a solution.

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Re: Arduino Help

by alainsam on Fri Apr 03, 2020 1:23 am

I tried these IDE version 1.812 1.8.10 1.8.8 and 1.6.13 with the same problem.
But with the online arduino Create it works!....
I still need to use the IDE on my computer and need a solution.

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Re: Arduino Help

by adafruit_support_carter on Fri Apr 03, 2020 11:03 am

One more library to check.

Adafruit BusIO = version?

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino Help

by alainsam on Fri Apr 03, 2020 1:35 pm

Is BusIO needed for this MAX 31855?

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Re: Arduino Help

by alainsam on Fri Apr 03, 2020 1:47 pm

I have these warnings when verifying the sketch:

C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Users\\alain\\Documents\\Arduino\\libraries\\Adafruit_BusIO" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\Wire\\src" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\alain\\Documents\\Arduino\\libraries\\Adafruit_MAX31855_library" "C:\\Users\\alain\\Documents\\Arduino\\libraries\\Adafruit_MAX31855_library\\Adafruit_MAX31855.cpp" -o "C:\\Users\\alain\\AppData\\Local\\Temp\\arduino_build_348315\\libraries\\Adafruit_MAX31855_library\\Adafruit_MAX31855.cpp.o"
In file included from C:\Users\alain\Documents\Arduino\libraries\Adafruit_MAX31855_library\
Adafruit_MAX31855.cpp:36:0:

C:\Users\alain\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.h:49:32:
warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t,
uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]

Adafruit_SPIDevice spi_dev = NULL;

^~~~

C:\Users\alain\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.cpp:
In member function 'uint32_t Adafruit_MAX31855::spiread32()':

C:\Users\alain\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.cpp:186:7:
warning: unused variable 'i' [-Wunused-variable]

int i;

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Re: Arduino Help

by adafruit_support_carter on Fri Apr 03, 2020 3:43 pm

SPIDevice comes from the BusIO library:
https://github.com/adafruit/Adafruit_BusIO

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino Help

by alainsam on Sun Apr 05, 2020 9:03 pm

I finally found the culprit of my MAX31855 problem: It was a bad connexion on the mini connector of the TC, sometimes it connected sometimes it did not. Kind of error hard to detect. Sorry to have alarmed you.

alainsam
 
Posts: 15
Joined: Tue Oct 04, 2016 7:58 pm

Please be positive and constructive with your questions and comments.