update spi, fix lcd error

This commit is contained in:
Erik Kettenburg 2016-02-12 19:09:37 -08:00
parent 2c40bcdd6f
commit 822a2e4f55
4 changed files with 6 additions and 8 deletions

View File

@ -4,11 +4,8 @@
#include <inttypes.h>
#include "Arduino.h"
#if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny2313__) || defined(__AVR_ATtiny167__)
#include "TinyWireM.h" // include this if ATtiny85 or ATtiny2313
#else
#include <Wire.h> // original lib include
#endif
#include "TinyWireM.h" // include this if ATtiny85 or ATtiny2313
// When the display powers up, it is configured as follows:
//

View File

@ -85,7 +85,7 @@ void loop() {
}
//Read from or write to register from the SCP1000:
unsigned int readRegister(byte thisRegister, int bytesToRead ) {
unsigned int readRegister(byte thisRegister, int bytesToRead) {
byte inByte = 0; // incoming byte from the SPI
unsigned int result = 0; // result to return
Serial.print(thisRegister, BIN);
@ -117,7 +117,7 @@ unsigned int readRegister(byte thisRegister, int bytesToRead ) {
// take the chip select high to de-select:
digitalWrite(chipSelectPin, HIGH);
// return the result:
return(result);
return (result);
}

View File

@ -36,7 +36,7 @@ const int slaveSelectPin = 10;
void setup() {
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
pinMode(slaveSelectPin, OUTPUT);
// initialize SPI:
SPI.begin();
}

View File

@ -4,6 +4,7 @@ author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. For all Arduino boards, BUT Arduino DUE.
paragraph=
category=Communication
url=http://www.arduino.cc/en/Reference/SPI
architectures=avr