Hi,
I have a very old setup of tinytx3s - one is setup as receiver and I got some sensors that send data. The receiver is connected to a raspberry and so the data is forwarded.
Now I would like to change something in the setup but I cannot get the attiny to communicate with the raspberry anymore. The old programmed attiny works like always and minicom shows the communication with
sudo minicom -b 9600 -o -D /dev/ttyAMA0
but I seem not to have the old sketch anymore ...
A new sample code does not do anything besides that the LED indicates that the sketch runs continually. Any idea what is different in the old sketch compared to that simplified snippet? As far as I checked the pin setup is correct.
#include <SoftwareSerial.h>
#define SERIAL_BAUD 9600
// UART pins
#define rxPin 7 // D7, PA3
#define txPin 3 // D3, PA7. pin der an RXD vom PI geht.
// LED pin
#define LEDpin 8 // D8, PA2 - set to 0 to disable LED
int i;
// Initialise UART
SoftwareSerial mySerial(rxPin, txPin);
static void activityLED (byte mode) {
pinMode(LEDpin, OUTPUT);
digitalWrite(LEDpin, mode);
}
// init Setup
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(SERIAL_BAUD);
mySerial.print("Test start\n\r");
if (LEDpin) {
activityLED(1); // LED on
delay(500);
activityLED(0); // LED off
delay(500);
activityLED(1); // LED on
delay(500);
activityLED(0); // LED off
}
i=0;
}
// Loop
void loop()
{
mySerial.println(i);
i++;
delay(500);
activityLED(1); // LED on
delay(100);
activityLED(0); // LED off
delay(500);
activityLED(1); // LED on
delay(20);
activityLED(0); // LED off
}