This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* USI SPI Slave Demo written by Robert Mollik, 2016 | |
* | |
* This demo uses the SPI protocol with USI interface. This is necessary with with the smaller AVR controller since they don't | |
* a complete SPI functionality. | |
* Demo is written for the pinout of an Arduino Trinket and ATtiny85. Pins need to be modified if a different controller is used. | |
* | |
* The demo takes receives a request ID from the Master at the beginning of every communication. According to the request ID, | |
* it sends back either a temperature or a humidity values. Since both values are present in float, the 4 bytes of the float need | |
* to be send separately. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For ($Num = 1; $Num -le 12: $Num ++) | |
{ #Do stuff | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* USI SPI Slave Demo written by Robert Mollik, 2016 | |
* | |
* This demo uses the SPI protocol with USI interface. This is necessary with with the smaller AVR controller since they don't | |
* a complete SPI functionality. | |
* Demo is written for the pinout of an Arduino Trinket and ATtiny85. Pins need to be modified if a different controller is used. | |
* | |
* The demo takes receives a request ID from the Master at the beginning of every communication. According to the request ID, | |
* it sends back either a temperature or a humidity values. Since both values are present in float, the 4 bytes of the float need | |
* to be send separately. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Sketch to show how to get the single bytes out of a float variable and resemble them to a new variable with the original Value. | |
* Can be used e. g. for the transfer via SPI, where only one byte at a time can be sent | |
* | |
* Robert Mollik 2016 | |
* | |
* Created in the content of the development of my weather station and the need to tranfser values via SPI. | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SPI Master Demo written by Robert Mollik, 2016 | |
* | |
* This demo uses the SPI protocol on a Arduino Uno R3 / ATmega8 controller | |
* | |
* The demo sends out a request ID depending, whether a temperature or humidity signal shall be obtained from the slave. Both signals | |
* are datatype float, however get received as 4 bytes and need to be re-assembled. | |
*/ | |
#define CS PC0 // Chip select pin, any vacant portpin can be used |