Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
// Include the SPI library const int slaveSelectPin = 10; // SS pin void setup() { pinMode(slaveSelectPin, OUTPUT); // Set SS pin as output SPI.begin(); // Initialize SPI Serial.begin(9600); // Start serial communication } void loop() { digitalWrite(slaveSelectPin, LOW); // Select the sensor SPI.transfer(0x00); // Send read command int temp = SPI.transfer(0x00); // Read temperature data digitalWrite(slaveSelectPin, HIGH); // Deselect the sensor Serial.print("Temperature: "); Serial.println(temp); delay(1000); // Wait for 1 second before next reading }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)