Add Tiny SoftwareSerial example
This example shows how to use softwareSerial in a ATtiny device using the ATtiny core
This commit is contained in:
parent
e0856e51d9
commit
2b75a0ddb4
2 changed files with 24 additions and 0 deletions
12
examples/TinySoftWareSerial/Makefile
Normal file
12
examples/TinySoftWareSerial/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
|
||||||
|
|
||||||
|
BOARD_TAG = attiny85-8
|
||||||
|
ARDUINO_VAR_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/variants
|
||||||
|
BOARDS_TXT = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/boards.txt
|
||||||
|
ISP_PORT = /dev/ttyACM*
|
||||||
|
|
||||||
|
ARDUINO_LIBS = SoftwareSerial
|
||||||
|
|
||||||
|
include $(ARDMK_DIR)/arduino-mk/Arduino.mk
|
||||||
|
|
||||||
|
# !!! Important. You have to use make ispload to upload when using ISP programmer
|
12
examples/TinySoftWareSerial/TinySoftwareSerial.ino
Normal file
12
examples/TinySoftWareSerial/TinySoftwareSerial.ino
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include <SoftwareSerial.h>
|
||||||
|
|
||||||
|
SoftwareSerial mySerial(3, 4); // RX, TX
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
mySerial.begin(9600);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
mySerial.println(millis());
|
||||||
|
delay(1000);
|
||||||
|
}
|
Loading…
Reference in a new issue