How to send Gcode to ATtiny13A

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. :confused:

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 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?

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.