InfraRed receiver+emitter


hi all, i've followed tutorial: http://playground.arduino.cc/code/infraredreceivers
and i've maked ir receiver , worked fine.
i wrote code repeat signal recorded when switch pressed:

void transmit()
{
 if(itsok == 1)
 {
   change_count = 0;
   lasttime=-1;
   deltatime=0;
   while (change_count < sample_size) {
     time = (long) timervalue[change_count] * 4;
     deltatime=time-lasttime;
     lasttime = time;
     serial.print(deltatime);
     serial.print("\t");
     delaymicroseconds(deltatime);
     bitprint = direction[change_count++];
     serial.print("invio bit: ");
     serial.println(bitprint);
     if(bitprint == '0') //o 1?
       digitalwrite(iremitterpin, low);
     else
       digitalwrite(iremitterpin, high);
   }
 }
 itsok = 0;
 delay(1000);
}

however emitter didn't works well...
the code right, in fact i've replaced ir emitter led standard led , multiplied 1000 delay , i've seen signal.
maybe electrically connection wrong?
i'm taking digital pinout , i'm using 220ohm resistance.
any ideas?

(i'm using ir led: http://store.arduino.cc/it/index.php?main_page=product_info&cpath=6_31&products_id=235)

thanks
daniele

that irled (http://arduino.cc/documents/datasheets/c000043%20-%20led%20ir.pdf) needs 100 ma, far more arduino pin can supply.  need transistor drive it, high current loads motors.


Arduino Forum > Using Arduino > LEDs and Multiplexing > InfraRed receiver+emitter


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62