I have a problem using ir sensor to send raw data of remote by using arduino

#include <IRremote.h>

IRsend irsend;
unsigned int raw[38] = {0xA8,0x52,0xA,0x9,0xB,0x1E,0xA,0xA,0xA,0xA,0x9,0xA,0xB,0xA,0xA,0xA,0xA,0xA,0xD,0x52,0xA,0xA,0x9,0x1E,0xB,0x1E,0xA,0x1E,0xA,0xA,0xB,0xA,0xA,0xA,0xA,0xA,0xA,};
unsigned int raw2[24] = {0x12,0x10,0x23,0x10,0x12,0x10,0x12,0x10,0x13,0x10,0x12,0x10,0x12,0x10,0x12,0x10,0x13,0x1F,0x12,0x10,0x23,0x10,0x12,};

void setup()
{
Serial.begin(9600);
}

void loop() {
int val = Serial.read() - '0';
if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {

if(val == 1)
{
irsend.sendRaw(raw,38,38); // Sony TV power code
irsend.sendRaw(raw2,24,38);
delay(40);
}
}
}
}

please help me this data i extracted to a universal remote =( =( =(

Ther are a few obvious issues, as follows:

  1. You have not put your posted code in a code block. "#" buttone in the edit toolbar.
  2. the timings for your signal are clearly wrong, so there is something amiss with your recording.
  3. The frequency being used is wrong (??? 99%+). Normally it is 40kHz for SONY.
  4. You should leave a gap of at least 40ms or 100ms between signals (approximations). sending the two signals together is incorrect, although you got the bit about sending the SONY signal 3 times correct.

So what to do next....If/when you edit & correct your previous post with the a 'code block', I willbe happy to make some more suggestions.

Hello, im a begginer in arduino, so i`ve been trying to build a code to control my a/c with a webserver, but i cant make it work can anybody help me telling me whats wrong with my code?

#include "SPI.h"
#include "Ethernet.h"
#include "WebServer.h"
#include <IRremote.h>

template
inline Print &operator <<(Print &obj, T arg)
{ obj.print(arg); return obj; }

//IR Variable declaration
IRsend irsend;

//acon
unsigned int airpower[38] = {8300,4150,550,1550,500,1600,500,1550,550,550,500,1600,500,550,550,1550,500,1600,500,4150,550,1550,550,1550,550,500,550,1550,550,500,550,500,550,500,550,500,650,};

//tempup
unsigned int tempdown[38] = {8250,4200,450,1650,450,1650,450,1650,500,550,450,1650,450,600,450,1650,450,1650,450,4200,450,600,500,550,500,1600,500,600,450,600,500,550,450,600,450,600,550,};

//tempdown
unsigned int tempup[38] = {8300,4150,500,1600,450,1650,450,1600,500,600,500,1600,450,600,500,1600,500,1600,500,4150,500,1600,500,550,500,1600,500,550,550,500,550,500,550,500,550,550,550,};

//auto
unsigned int autop[38] = {8300,4150,500,1600,500,1600,500,1600,500,550,500,1600,500,550,500,1600,500,1600,500,4150,500,1600,500,1600,500,550,500,600,450,600,450,600,450,600,450,600,550,};

//powersaver
unsigned int pwsaver[38] = {8250,4200,500,1600,500,1600,500,1550,500,600,450,1650,450,600,500,1600,500,1600,450,4200,500,550,500,1600,500,550,500,1600,500,550,500,550,500,550,550,550,550,};

// MAC
static uint8_t mac[] = { 0xA2, 0xB8, 0xD8, 0xD4, 0xFD, 0x43 };

// IP
static uint8_t ip[] = { 192, 168, 1, 103 };

#define PREFIX ""

WebServer webserver(PREFIX, 80 );

void acOn(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
if (type == WebServer::POST)
{
server.httpFail();
return;
}

//server.httpSuccess(false, "application/acOn");
server.httpSuccess();

//Replace for your IR Code here.
irsend.sendRaw(airpower,38,38);
delay(40);
}

void tempUp(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
if (type == WebServer::POST)
{
server.httpFail();
return;
}

server.httpSuccess();

//Replace for your IR Code here.
irsend.sendRaw(tempup,38,38);
delay(40);

}

void tempDown(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
if (type == WebServer::POST)
{
server.httpFail();
return;
}

server.httpSuccess();

//Replace for your IR Code here.
irsend.sendRaw(tempdown,38,38);
delay(40);
}

void autoP(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
if (type == WebServer::POST)
{
server.httpFail();
return;
}

server.httpSuccess();

//Replace for your IR Code here.
irsend.sendRaw(autop,38,38);
delay(40);
}

void pwSaver(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
{
if (type == WebServer::POST)
{
server.httpFail();
return;
}

server.httpSuccess();

//Replace for your IR Code here.
irsend.sendRaw(pwsaver,38,38);
delay(40);
}

void setup()
{

Ethernet.begin(mac, ip);
webserver.begin();

webserver.addCommand("acon", &acOn);
webserver.addCommand("tempup", &tempUp);
webserver.addCommand("tempdown", &tempDown);
webserver.addCommand("autop", &autoP);
webserver.addCommand("pwsaver", &pwSaver);
}

void loop()
{
webserver.processConnection();

}

anybody help me telling me whats wrong with my code?

#7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html