Skip to content

Commit

Permalink
delay altered for compatibility with other Arduino boards
Browse files Browse the repository at this point in the history
delay altered for compatibility with other Arduino boards, LCD
thermocouple example changed for pin consistency
  • Loading branch information
andydoro committed Nov 6, 2015
1 parent ccc7278 commit 3f33513
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 5 additions & 6 deletions Adafruit_MAX31855.cpp
Expand Up @@ -21,7 +21,6 @@
#include <pgmspace.h>
#endif

#include <util/delay.h>
#include <stdlib.h>
#include <SPI.h>

Expand Down Expand Up @@ -136,21 +135,21 @@ uint32_t Adafruit_MAX31855::spiread32(void) {
}

digitalWrite(sclk, LOW);
_delay_ms(1);
delay(1);
digitalWrite(cs, LOW);
_delay_ms(1);
delay(1);

for (i=31; i>=0; i--)
{
digitalWrite(sclk, LOW);
_delay_ms(1);
delay(1);
d <<= 1;
if (digitalRead(miso)) {
d |= 1;
}

digitalWrite(sclk, HIGH);
_delay_ms(1);
delay(1);
}

digitalWrite(cs, HIGH);
Expand All @@ -167,7 +166,7 @@ uint32_t Adafruit_MAX31855::hspiread32(void) {
} buffer;

digitalWrite(cs, LOW);
_delay_ms(1);
delay(1);

for (i=3;i>=0;i--) {
buffer.bytes[i] = SPI.transfer(0x00);
Expand Down
10 changes: 6 additions & 4 deletions examples/lcdthermocouple/lcdthermocouple.ino
Expand Up @@ -17,12 +17,14 @@
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>

int thermoCLK = 3;
int thermoCS = 4;
int thermoDO = 5;
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define DO 3
#define CS 4
#define CLK 5

// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
Adafruit_MAX31855 thermocouple(CLK, CS, DO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

Expand Down
File renamed without changes.

0 comments on commit 3f33513

Please sign in to comment.