From 2b75a0ddb48b8aef12d2c67089f7189cb00ceab3 Mon Sep 17 00:00:00 2001 From: Sudar Date: Sat, 22 Jun 2013 15:35:01 +0530 Subject: [PATCH] Add Tiny SoftwareSerial example This example shows how to use softwareSerial in a ATtiny device using the ATtiny core --- examples/TinySoftWareSerial/Makefile | 12 ++++++++++++ examples/TinySoftWareSerial/TinySoftwareSerial.ino | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 examples/TinySoftWareSerial/Makefile create mode 100644 examples/TinySoftWareSerial/TinySoftwareSerial.ino diff --git a/examples/TinySoftWareSerial/Makefile b/examples/TinySoftWareSerial/Makefile new file mode 100644 index 0000000..b68f08d --- /dev/null +++ b/examples/TinySoftWareSerial/Makefile @@ -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 diff --git a/examples/TinySoftWareSerial/TinySoftwareSerial.ino b/examples/TinySoftWareSerial/TinySoftwareSerial.ino new file mode 100644 index 0000000..a53e059 --- /dev/null +++ b/examples/TinySoftWareSerial/TinySoftwareSerial.ino @@ -0,0 +1,12 @@ +#include + +SoftwareSerial mySerial(3, 4); // RX, TX + +void setup() { + mySerial.begin(9600); +} + +void loop() { + mySerial.println(millis()); + delay(1000); +}