cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

How to paste raw data :/ ?? #4

Closed Zuzuske closed 3 months ago

Zuzuske commented 7 years ago

Hi, nice library, receiving works great, but i just dont get it how to send raw data, im a little bit confused, need help, i tried multiple paste variations and still get an error.

I have this:

Ready to receive IR signals Do a cut-and-paste of the following lines into the designated location in rawSend.ino

define RAW_DATA_LEN 68

uint16_t rawData[RAW_DATA_LEN]={ 4400, 4450, 550, 1650, 550, 1650, 550, 1650, 500, 550, 550, 550, 500, 550, 550, 500, 550, 550, 500, 1700, 500, 1700, 500, 1650, 550, 550, 550, 500, 550, 500, 550, 550, 550, 500, 550, 550, 500, 1700, 500, 550, 500, 550, 550, 550, 500, 550, 550, 500, 550, 550, 500, 1700, 500, 550, 500, 1700, 500, 1700, 550, 1650, 500, 1700, 500, 1700, 500, 1700, 500, 1000};

Where and how much do i have to paste of this in here (whole method below).

void irTransmitter() { if (bttnSTATE == HIGH) { myRawSender.send(rawData,RAW_DATA_LEN,36); Serial.println(F("Sent signal.")); } }

could you do this specific example, how should the whole method look after pasting raw code?

cyborg5 commented 7 years ago

Everything from the #define that you have listed there down through the… 1000); should be cut and pasted into the rawSend.ino sketch at approximately the line 22. See the comments in the rawSend example. Also see section 2.3.3 in the users manual.

You can modify that sketch to work off of a pushbutton instead of the serial monitor as you have shown. As to where to pasted in that particular sketch that you have shown, it depends on where you want the data to be assessable. You can post it globally in the sketch or you could put it inside your right before your if statement.

Zuzuske commented 7 years ago

oh. stupid me. i was trying to paste the code in method field @ myRawSender.send(rawData, RAW_DATA_LEN, 36);

also if i paste it in global field im getting an error.

cyborg5 commented 7 years ago

See the table in the users manual section 1.5.1 reveals the default pin number for a mega is pin 9.

Zuzuske commented 7 years ago

yeah sorry for stupid questions. i opened and read through the manual again.