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
char buf[100]; byte c=0,b=0; volatile byte pos; volatile boolean processing; byte i; void setup(void) { // put your setup code here, to run once: Serial.begin(9600); pinMode(MISO,OUTPUT); pinMode(MOSI,INPUT); SPCR |= _BV(SPE); pos = 0; processing = false; SPI.attachInterrupt(); } ISR(SPI_STC_vect){ c = SPDR; // SPDR = 0x55; // if(pos<20){ // buf[pos++] = c; // if(c == '\n') // processing=true; // } processing = true; } void loop(void) { // put your main code here, to run repeatedly: if(processing){ // Serial.println("Inside Processing"); Serial.println(c); processing = false; SPDR = i; i = i+1; } }
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)