mirror of
				https://github.com/digistump/DigistumpArduino.git
				synced 2025-10-31 04:24:48 -07:00 
			
		
		
		
	update spi, fix lcd error
This commit is contained in:
		| @@ -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: | ||||
| // | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -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(); | ||||
| } | ||||
|   | ||||
| @@ -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 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Erik Kettenburg
					Erik Kettenburg