I'm trying to send M commands to an ATtiny13A that has already been programmed. The Attiny responds to M280 commands to actuate a small solenoid. I'm trying to figure out if the dang thing works.
What I want to do is send the commands from the Arduino Uno to the ATtiny either via the serial monitor or in the loop.
I know this is simple, but my coding skills are limited to cut and paste.
Thanks for any help.
As you never responded to my Reply in your other Thread with same question I don't have any better answer to offer.
...R
I apologize for that. I got distracted by other things. (sick dog) Iāve since learned the the device is an ATtiny.
My knowledge of coding limited, but Iāve found a sketch that looks like what I need. The last line is Serial.println. But I canāt get it to compile.
#include <SoftwareSerial.h>
#define RX 3 // *** D3, Pin 2
#define TX 4 // *** D4, Pin 3
SoftwareSerial Serial(RX, TX);
void setup()
{
Serial.begin(9600);
Serial.println(āInitializingā¦ā);
}
I get an error at SoftwareSerial Serial(RX, TX); about a conflicting declaration.
Iāv epoke around and canāt find the solution. Can you help me with that?
Thanks,
Chris
I donāt know if the SoftwareSerial library works on an Attiny13A
But you need to post the exact error message.
ā¦R
PS ⦠To make it easy for people to help you please use the code button </> so your code looks like this
and is easy to copy to a text editor. See How to use the Forum
I'll do that when I get home tonight. Thanks
My understanding is that youāre trying to get Software Serial to work on the Uno, which you will use to send commands to an ATTiny13A. If thatās wrong then can you also know what core you are using for the ATTiny13A?
chriscuddihy:
⦠But I canāt get it to compile.#include <SoftwareSerial.h>
#define RX 3 // *** D3, Pin 2
#define TX 4 // *** D4, Pin 3SoftwareSerial Serial(RX, TX);
void setup()
{
Serial.begin(9600);
Serial.println(āInitializingā¦ā);
}I get an error at SoftwareSerial Serial(RX, TX); about a conflicting declaration.
Iāv epoke around and canāt find the solution. Can you help me with that?
Iāve found the problem with this. Iāll give you a hint to the solution. I assume that youāre going to want to use both hardware serial and software serial. Maybe hardware serial to talk to the computer and software serial to talk to the ATTiny13A?
Normally if you wanted to use hardware serial youād use code like this:
Ā Serial.begin(9600);
Ā Serial.println("Initializing...");
Does that maybe look like anything in your code? And are you trying to use with with hardware serial?
I assume that youāre going to want to use both hardware serial and software serial.
the ATtiny13 doesnāt have a hardware serial port.
But suspecting a collision of the name with the āSerialā port that exists on most arduinos seems pretty reasonable!
Try replacing all the occurrences of āSerialā with āSSerialāā¦
westfw:
the ATtiny13 doesn't have a hardware serial port.
That is a good point. I haven't used (or looked into) the Tiny13A- I assumed it implemented USI or software serial in the same way as hardware serial.
Having said that, because the OP said this:
chriscuddihy:
I'm trying to send M commands to an ATtiny13A that has already been programmed...
What I want to do is send the commands from the Arduino Uno to the ATtiny either via the serial monitor or in the loop.
I assumed this thread was more about sending the serial from the Uno, rather than dealing with the ATTiny13A side of things.