-
Notifications
You must be signed in to change notification settings - Fork 7
Class Instantiation
Arnd edited this page Sep 10, 2017
·
6 revisions
The MAX31855 library can be instantiated using either hardware SPI or software SPI.
The SPI protocol requires 4 lines to be used:
- MISO (Master In Slave Out) - The Slave line for sending data to the master.
- MOSI (Master Out Slave In) - The Master line for sending data to the peripherals, unused by the MAX31855.
- SCK (Serial Clock) - The clock pulses which synchronize data transmission generated by the master.
- CS/SS (Chip Select or Slave Select)
When using hardware SPI the MISO and SCK lines are defined by the Arduino SPI Library and are dependent upon which Arduino is being used. Only the CS pin needs to be defined in the program and it should be a digital pin.
When using software SPI all 3 lines need to be defined, the CS and SCK lines are output only while the MISO line is input.
#include <MAX31855.h> // MAX31855 Thermocouple Library
...
const uint8_t CS_PIN = 2;
MAX31855_Class thermocouple;
...
thermocouple.begin(CS_PIN);