I'm trying to port some Arduino code that I wrote for the Arduino Mega to an ATtiny and I'm having trouble figuring out how to do output. Here is what I have:
char foo;
#include <SoftwareSerial.h>
const int rx=3;
const int tx=4;
SoftwareSerial mySerial(rx,tx);
void setup()
{
mySerial.begin(9600);
}
void loop() {
if (mySerial.available()) {
char data = mySerial.read();
mySerial.write(data);
}
mySerial.println("hello");
}
To my understanding this should print "hello" to the console over and over again but for some reason it uploads successfully but then it doesn't do anything.
Here is the programmer that I am using to connect my ATtiny to my computer: https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/programming-in-arduino