I've tried several different IrLED's but they all do the same. They do a fade blink every now and then while it's spamming the codes.
Any idea why? I have the Arduino Mega.
November 25, 2010 at 6:33 AM
Anonymous said...
Thx for the nice conversion and upgrade. Version 1.2 runs fine on my arduino nano.
(TV-B-Gone for Arduino version 0.001 Ported to Arduino by Ken Shirriff, Dec 3, 2009 http://arcfn.com The original code is: TV-B-Gone Firmware version 1.2)
But : I have to set digital pin 5 floating to to turn my european phi**ips tv on and off (place germany/eu ;-); the tv was bought in germany). If i ground digital pin 5 my tv just switches channels several times during a single run. I tried this with a fet and a MOSFET (IRLU 2905) as driver for my IR LED ->no changes. Hardware for IRLU 2905: Source connected to GND, Gate connected to arduino out (digital pin 3) with 10 KOhm to ground to get a proper not floating MOSFET gate and Drain connected to IR-LED with 39 Ohm in series to VCC/+5Volt). This works for a distance of several meters and really large IR LEDs or several ;-). With a floating digital pin 5 everything works like it should. It toggles tv off or on with every single run, no channel switching. Just one single action per run.
turbo_b. 28th of dec.2010
December 28, 2010 at 10:06 AM
Anonymous said...
Thanks Ken
Arduino TV B-Gone v 1.2 is running fine.
I noticed that the "region blink", that the LED runs at first power up, is delayed by 3 seconds.
I will report back the current draw on the ATmega in a few days.
cheers!
January 1, 2011 at 4:39 PM
Anonymous said...
How hard would this be to adapt to use Ladyada's setup with two narrow beams and two wide beams?
January 11, 2011 at 10:09 PM
Anonymous said...
Do I have to use three AA batteries or can i just use a 9v? Thanks!
Anonymous1: the Arduino can take up to 12 volts input voltage: http://www.arduino.cc/en/Main/ArduinoBoardDiecimila
Anonymous2: you can easily add 4 LEDs, but you'll need 5 transistors. See Ladyada's schematic for how to hook it up: http://www.ladyada.net/make/tvbgone/design.html
January 13, 2011 at 8:05 AM
Anonymous said...
Thanks Ken!
January 13, 2011 at 10:12 PM
hippi97 said...
don't work i got error: TVB\WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here TVB\WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here TVB\WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes' WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here TVB\WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes' WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
Hey thank you for this port. I followed your design using a seeduino and it worked out better than expected. I get ~10m range at night. I built it into an old eyeglasses case and took it to the bars and had a lot of fun. Im using 4 AA's curently but a 9V doesnt seem to have enough (amps maybe?) to run the setup because the onboard led only flickers dimly and it doesnt seem to function. In order to make the whole thing smaller im probably going to use a smaller arduino and some AAA's.
please execuse me b/c i'm a newbie. in your hand sketch, there's a value of "47" above the resistor connecting to pin 3 of arduino and another of "10" connecting to IR LED. are they 47 ohm and 10 ohm respectively ?
August 10, 2011 at 1:54 PM
mutiemouse said...
Just a note for Mega users, use pin 9 instead of 3 for connecting of the LED driver circuit. Also change "#define IRLED 3" in "main.h" to 9. Mega uses different timers for the pins. Ref: http://www.mythic-beasts.com/~markt/ATmega-timers.html
October 1, 2011 at 2:44 PM
Anonymous said...
Hi,
I built the circuit (a bit differently than suggested) and it works as it should. :-)
I have some questions: What currents Ib and Ic are occuring in the suggested circuit?
Isn't the value of the 47 Ohms resistor too low?
I just want to make sure that no critical currents are exceeded and the Arduino does not get damaged...
Or is everything o.k., because the IR Led is only pulsed?
nice! and thanx. when saw this and directly made one! : http://youtu.be/KGvcM2i-P4o
November 20, 2011 at 7:15 AM
Anonymous said...
No luck with mine programmed with a 5V/16Mhz Arduino Nano and Pin 5 is floating. I can replace the IR led with a green one and see it blink the codes but the TV never goes off. I'll try another IR led and use a 5 volt power supply.
Hi, thanks! This is great! But first, it didn't work with my Panasonic TV. The signal has to take about 2 seconds to turn off the TV, so I added a for-loop (3 times) for every POWER code. Now it works!
no matter what i do my arduino uno and the sketchbook keeps getting errors with irremote sketches what do i do?
July 12, 2012 at 9:04 PM
prometheus said...
This project is so cool, so I want to use this code. but, there are some problems I got some errors.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)': TVB:91: error: 'TCCR2A' was not declared in this scope TVB:91: error: 'COM2A0' was not declared in this scope TVB:91: error: 'COM2B1' was not declared in this scope TVB:92: error: 'TCCR2B' was not declared in this scope TVB:92: error: 'WGM22' was not declared in this scope TVB:105: error: 'TCCR2A' was not declared in this scope TVB:106: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void setup()': TVB:190: error: 'TCCR2A' was not declared in this scope TVB:191: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void sendAllCodes()': TVB:273: error: 'OCR2A' was not declared in this scope TVB:274: error: 'OCR2B' was not declared in this scope
please help me. please
August 16, 2012 at 9:56 AM
prometheus said...
So nice article
excuse me, but I have some errors. please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)': TVB:91: error: 'TCCR2A' was not declared in this scope TVB:91: error: 'COM2A0' was not declared in this scope TVB:91: error: 'COM2B1' was not declared in this scope TVB:92: error: 'TCCR2B' was not declared in this scope TVB:92: error: 'WGM22' was not declared in this scope TVB:105: error: 'TCCR2A' was not declared in this scope TVB:106: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void setup()': TVB:190: error: 'TCCR2A' was not declared in this scope TVB:191: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void sendAllCodes()': TVB:273: error: 'OCR2A' was not declared in this scope TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:57 AM
prometheus said...
So nice article
excuse me, but I have some errors. please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)': TVB:91: error: 'TCCR2A' was not declared in this scope TVB:91: error: 'COM2A0' was not declared in this scope TVB:91: error: 'COM2B1' was not declared in this scope TVB:92: error: 'TCCR2B' was not declared in this scope TVB:92: error: 'WGM22' was not declared in this scope TVB:105: error: 'TCCR2A' was not declared in this scope TVB:106: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void setup()': TVB:190: error: 'TCCR2A' was not declared in this scope TVB:191: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void sendAllCodes()': TVB:273: error: 'OCR2A' was not declared in this scope TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:57 AM
prometheus said...
So nice article
excuse me, but I have some errors. please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)': TVB:91: error: 'TCCR2A' was not declared in this scope TVB:91: error: 'COM2A0' was not declared in this scope TVB:91: error: 'COM2B1' was not declared in this scope TVB:92: error: 'TCCR2B' was not declared in this scope TVB:92: error: 'WGM22' was not declared in this scope TVB:105: error: 'TCCR2A' was not declared in this scope TVB:106: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void setup()': TVB:190: error: 'TCCR2A' was not declared in this scope TVB:191: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void sendAllCodes()': TVB:273: error: 'OCR2A' was not declared in this scope TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:59 AM
prometheus said...
So nice article
excuse me, but I have some errors. please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)': TVB:91: error: 'TCCR2A' was not declared in this scope TVB:91: error: 'COM2A0' was not declared in this scope TVB:91: error: 'COM2B1' was not declared in this scope TVB:92: error: 'TCCR2B' was not declared in this scope TVB:92: error: 'WGM22' was not declared in this scope TVB:105: error: 'TCCR2A' was not declared in this scope TVB:106: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void setup()': TVB:190: error: 'TCCR2A' was not declared in this scope TVB:191: error: 'TCCR2B' was not declared in this scope TVB.cpp: In function 'void sendAllCodes()': TVB:273: error: 'OCR2A' was not declared in this scope TVB:274: error: 'OCR2B' was not declared in this scope
hmm im curious. Would I be able to run this code properly on an arduino lillypad 8Mhz. I ask because I remember in the TV b gone the schematic referenced such an oscillator.
I had the same errors as hippi97, and they went away when I moved the TVB folder out of libraries. Now I have a different error: avrdude: stk500_getsync(): not in sync: resp=0x00
I'm using an adafruit flora , but there isn't a pin 5 ,in it and this is the same code as provided by adafruit. ineed to change the region to EU for south america codes , the circuit looks and works but for the NA , how can i change it?
Ken, thanks for all your super hard work on this, and to Mitch Altman and Limor Fried (LadyAda) of course too! I finally got around to making my first ever TV B Gone, which is something I've wanted for over 6 months now! :) Here's a picture:
1) http://bit.ly/1diFnqp 2) http://bit.ly/1pXmoad
Thanks again! Sincerely, Gabriel http://electricrcaircraftguy.blogspot.com/
March 3, 2014 at 4:22 PM
Alex said...
The resistors are of 10K and 47K or 10ohms and 47ohms??
Could someone do the same but to work on Atmega8A? Is it possible? I've got lots of these. PLEASE
November 10, 2014 at 4:49 PM
Anonymous said...
i have tested the code and i have some problems :
TVB\WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here TVB\WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here TVB\WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes' WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here TVB\WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes' WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
Tested with arduino 1.0.5 for an atmega 168.
November 24, 2014 at 12:57 PM
Durss said...
I try my chance here with not much hope :D I want to run this on a 12Mhz clock. I tried changing DELAY_CTN to 11 but it doesn't seem to work.
Would you have any advice on how to i could make it work for such a device (a Pro Trinket 3V/12Mhz from adafruit).
if that comment was for me, about the resistors, here's my answer: I can't vouch for that picture with 100% certainty anymore because I made that device a long time ago and have since permanently moved it to a PCB somewhere, but I have since then built another 6 or 8 or so TVBGones (as gifts) and I am most often using the following: Transistor: 2N3904 R_base = 510 Ohms R_collector = 10 Ohms
The Arduino I'm using in the picture is a cheapo 5V Pro Mini, and I'm running the regulated 5V to the transistor Collector (though you could probably pull more power and get better IR range if you resized the resistors and ran power straight from the 9V battery to the Collector instead).
My range is ~15 ft. Maybe a touch more if you have good aim.
TVB/WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here TVB/WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here TVB/WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes' WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here TVB/WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes' WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
Ken, I want to let you know I have put your code on Github, here: https://github.com/ElectricRCAircraftGuy/TVBGone. This will hopefully make it easier for people to add to it if they wish, or edit it to port to other devices if they wish. I have made only very minor changes to it. I may have changed some pins or something (it was a long time ago I worked on it), and I added debouncing to the button (prob. not necessary, but I did it anyway to be thorough). Anyway, just wanted to let you know. For complete info people can read the readme at my link above.
FYI Everyone, this code will NOT compile in Arduino 1.5.7 or later, due to the newer Arduino IDEs using a newer version of the gcc compiler, which has changed the way progmem is handled. I am using Arduino 1.5.6-r2 Beta to compile and upload this code to my Arduino.
~Gabriel Staples
March 5, 2015 at 8:48 AM
Anonymous said...
Thanks gabe, please update your code Ken i really wanna make this dope device
March 5, 2015 at 2:13 PM
Anonymous said...
I keep getting an error saying StructIrCode is already defined or something, even when using the older software. (1.5.2 rev 2 beta). Please help me out with this i need to get this in for science fair asap.
Ken, sorry for posting a slightly modified version of your code on GitHub without properly forking it. Somehow I overlooked your GitHub link at the bottom of your article above, or I would have forked from there. In either case, when I get the chance I'll help update to update your root version of the code to make it compatible with the current Arduino IDE, so that will be something I get to sometime.
March 7, 2015 at 5:06 AM
Anonymous said...
Gabriel, I will be checking this website frequently. Please let me know when you fix the code and how i can access it. Thanks,
Hi ken, im doing the tv b gone and when i compile the project i get this error comment, if u can hlep me, i would be very pleased. Thanks for your time
In file included from main.h:1:0, from TVB.ino:33: TVB:78: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' TVB:79: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
May 16, 2015 at 3:44 AM
Brett Ostrom said...
Any fix for:
"undefined reference to 'NApowerCodes'"
... and ...
"undefined reference to 'EUpowerCodes'"
after const has been added?
June 5, 2015 at 10:12 AM
Anonymous said...
i have got these error codes:
In file included from main.h:1:0, from TVB.pde:33: TVB.pde:78:30: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' TVB.pde:79:30: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' Error compiling.
can someone help me please?
July 15, 2015 at 8:59 AM
Anonymous said...
IF YOU GET NAPOWERCODES OR EUPOWERCODES MUST BE CONST,DOWNGRADE YOUR ARDUINO IDE. TEST IT. IT WORKS.
August 30, 2015 at 7:57 AM
Brett Ostrom said...
Here is a link to the TV-B-Gone sketch which has been corrected and WILL COMPILE/RUN on an Arduino Uno @ 16Mhz, AND BUILDS IN THE NEW ARDUINO SOFTWARE. If you have been an able to build the sketch and run it on your Arduino UNO, TRY THIS -- IT WORKS!
The above URL, to that sketch, can be found here: http://cornfieldelectronics.com/cfe/projects/tvbg_arduino/tvbg_arduino_workshop.php Just look, on the page, for, "3) You also need the TV-B-Gone Arduino Sketch"
November 28, 2015 at 12:00 PM
Anonymous said...
I also have the problem of that when I try to compile it broadcasts these errors: TVB/WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here TVB/WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes' WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here TVB/WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes' WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here TVB/WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes' WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here And can't figure out how to fix them with my limited knowledge of coding, any ideas? Please help its a cool project but I cant get it to Work.
May 1, 2016 at 1:05 PM
Anonymous said...
Ok, so now I fixed those errors with a version after 1.5.7, but Im getting diffrent errors like: In file included from main.h:1:0, from TVB.ino:33: TVB.ino:78:30: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' TVB.ino:79:30: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))' Error compiling. Please help.
Hi all. for those who encountered errors: i had the same problem with all of you, every few lines some error occurs, after a few hours of playing with the code and the libraries and reading the Ken's method (http://www.righto.com/) of coding for hundreds of times, i found that the problem is not the code itself, I've tried fixing every error, changing every port and finally came to this: version 1.0.3 (http://arduino.googlecode.com/files/arduino-1.0.3-windows.zip) of arduino IDE for windows, just uploaded it to my UNO R3 without any errors and it works great. i have used no transistors or resistors, just pinned anode of the IR LED to pin 3 and then grounded the LED cathode to GND right next to pin 13. turns every single TV that i have tested so far off, 30 years olds from sony to toshiba and high end samsung TVs.
Evan, Marti, Brett, Michel, Joseph, Amir, Mistifyer, and anyone else who couldn't get the code to compile, please see my link just above. I just updated the code on GitHub. Let me know via the GitHub Issues page if you have any problems. ~Gabriel, www.ElectricRCAircraftGuy.com
I tried this project a few months ago but came across many of the same errors as the people above. This new code works excellently and without any problems.
Although I did have a question, inside the new code you give instructions on how to build it: The hardware for this project uses an Arduino: Connect an IR LED to pin 3 (IRLED). Connect a visible LED to the pin 13 (or use the built-in LED in many Arduinos). Connect a push-button between pin 2 (TRIGGER) and ground. Pin 5 (REGIONSWITCH) must be left floating for North America, or wire it to ground to have it output European codes.
I was interested in whether there is still benefit to using a transistor and resistor attached to the IR led? What is your experience?
I made your modified project, and it works. I am in Europe, and the Europe link is in place. Until now, I only try it on my own TV, but sadly it doesn't work on it.
I adjusted the resistor quite low to get a strong power on the IR's leds. They looks to work well (looking with a camera on it)
Will try again on other TV's
The goal going this hack was to be able to shut off TV in front of us, because my 2 years old girl never see TV's and I don't want her to see until older. By the way now our gov. recognize Child under 3 should never see TV, but it's not yet illegal to let them see.
Bring some addition and affect at lot child's brain enhancement.
Thanks a lot for your work. Previous versions were not possible anymore to use on arduinos !
"Just a note for Mega users, use pin 9 instead of 3 for connecting of the LED driver circuit. Also change "#define IRLED 3" in "main.h" to 9." (before that change it did not work on the Arduino Mega Board I have)
[Image]
Oct 2016: An updated version of the code is on github, thanks to Gabriel Staples.
The TV-B-Gone is a tiny infrared remote that can turn off almost any TV. A while ago, I ported the TV-B-Gone software to the Arduino; for details on the port and how it works see my previous post on the Arduino TV-B-Gone.
Mitch Altman, the inventor of the TV-B-Gone, made some improvements to the code for a weekly TV-B-Gone constructing workshop in San Francisco at Noisebridge. If you're in the San Francisco area and are interested in the TV-B-Gone, you might want to check it out.
The main bug fix in the new version is the European codes will now work (if you ground pin 5). (The problem was a bunch of #ifdefs to fit the codes into the ATtiny's limited memory; taking out the #ifdefs fixed the problems.) Pressing the trigger button during transmission will now restart the codes. The delay between codes was increased, which should make transmission more reliable. The Arduino's processor will now sleep when not transmitting (thanks to ka1kjz). (Unfortunately, the rest of the Arduino components are still draining power, so sleep mode will be more useful with stripped-down Arduino variants.)
Important: the pins have been changed around in the new version (to avoid conflicts with the serial port). Pin 2 is now the trigger switch, Pin 3 is the IR output, and Pin 5 is grounded if you want European codes. If you built an Arduino TV-B-Gone before and want to use the new code, make sure you connect to the right pins.
Here's Mitch Altman's schematic for the Arduino TV-B-Gone (click for larger):
[Image]
To build the Arduino TV-B-Gone, follow the above schematic and download the sketch from github.
My previous post on the Arduino TV-B-Gone has more information on wiring it up, if you need it.
"Improved Arduino TV-B-Gone"
60 Comments -
Nice article, thanks for the information.
November 10, 2010 at 12:56 AM
I've tried several different IrLED's but they all do the same.
They do a fade blink every now and then while it's spamming the codes.
Any idea why? I have the Arduino Mega.
November 25, 2010 at 6:33 AM
Thx for the nice conversion and upgrade. Version 1.2 runs fine on my arduino nano.
(TV-B-Gone for Arduino version 0.001
Ported to Arduino by Ken Shirriff, Dec 3, 2009
http://arcfn.com
The original code is:
TV-B-Gone Firmware version 1.2)
But :
I have to set digital pin 5 floating to to turn my european phi**ips tv on and off (place germany/eu ;-); the tv was bought in germany). If i ground digital pin 5 my tv just switches channels several times during a single run.
I tried this with a fet and a MOSFET (IRLU 2905) as driver for my IR LED ->no changes.
Hardware for IRLU 2905:
Source connected to GND,
Gate connected to arduino out (digital pin 3) with 10 KOhm to ground to get a proper not floating MOSFET gate and
Drain connected to IR-LED with 39 Ohm in series to VCC/+5Volt).
This works for a distance of several meters and really large IR LEDs or several ;-).
With a floating digital pin 5 everything works like it should. It toggles tv off or on with every single run, no channel switching. Just one single action per run.
turbo_b. 28th of dec.2010
December 28, 2010 at 10:06 AM
Thanks Ken
Arduino TV B-Gone v 1.2 is running fine.
I noticed that the "region blink", that the LED runs at first power up, is delayed by 3 seconds.
I will report back the current draw on the ATmega in a few days.
cheers!
January 1, 2011 at 4:39 PM
How hard would this be to adapt to use Ladyada's setup with two narrow beams and two wide beams?
January 11, 2011 at 10:09 PM
Do I have to use three AA batteries or can i just use a 9v? Thanks!
January 11, 2011 at 10:45 PM
Anonymous1: the Arduino can take up to 12 volts input voltage: http://www.arduino.cc/en/Main/ArduinoBoardDiecimila
Anonymous2: you can easily add 4 LEDs, but you'll need 5 transistors. See Ladyada's schematic for how to hook it up: http://www.ladyada.net/make/tvbgone/design.html
January 13, 2011 at 8:05 AM
Thanks Ken!
January 13, 2011 at 10:12 PM
don't work i got error:
TVB\WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here
TVB\WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here
TVB\WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes'
WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here
TVB\WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes'
WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
Please help this is so cool
February 9, 2011 at 6:16 AM
@hippi97
I get those errors if I (mistakenly) unzip to sketchbook/libraries. Moved it to just sketchbook and the errors went away. Maybe your problem?
February 23, 2011 at 10:47 AM
Hey thank you for this port. I followed your design using a seeduino and it worked out better than expected. I get ~10m range at night. I built it into an old eyeglasses case and took it to the bars and had a lot of fun. Im using 4 AA's curently but a 9V doesnt seem to have enough (amps maybe?) to run the setup because the onboard led only flickers dimly and it doesnt seem to function. In order to make the whole thing smaller im probably going to use a smaller arduino and some AAA's.
May 26, 2011 at 7:40 AM
please execuse me b/c i'm a newbie. in your hand sketch, there's a value of "47" above the resistor connecting to pin 3 of arduino and another of "10" connecting to IR LED. are they 47 ohm and 10 ohm respectively ?
August 10, 2011 at 1:54 PM
Just a note for Mega users, use pin 9 instead of 3 for connecting of the LED driver circuit. Also change "#define IRLED 3" in "main.h" to 9.
Mega uses different timers for the pins. Ref: http://www.mythic-beasts.com/~markt/ATmega-timers.html
October 1, 2011 at 2:44 PM
Hi,
I built the circuit (a bit differently than suggested) and it works as it should. :-)
I have some questions:
What currents Ib and Ic are occuring in the suggested circuit?
Isn't the value of the 47 Ohms resistor too low?
I just want to make sure that no critical currents are exceeded and the Arduino does not get damaged...
Or is everything o.k., because the IR Led is only pulsed?
Thanks!
Josef
November 5, 2011 at 2:12 PM
nice! and thanx. when saw this and directly made one! : http://youtu.be/KGvcM2i-P4o
November 20, 2011 at 7:15 AM
No luck with mine programmed with a 5V/16Mhz Arduino Nano and Pin 5 is floating. I can replace the IR led with a green one and see it blink the codes but the TV never goes off. I'll try another IR led and use a 5 volt power supply.
January 5, 2012 at 4:43 AM
Hi,
thanks! This is great!
But first, it didn't work with my Panasonic TV. The signal has to take about 2 seconds to turn off the TV, so I added a for-loop (3 times) for every POWER code. Now it works!
May 1, 2012 at 11:32 AM
nice job. Works fine.
July 7, 2012 at 12:20 PM
no matter what i do my arduino uno and the sketchbook keeps getting errors with irremote sketches what do i do?
July 12, 2012 at 9:04 PM
This project is so cool, so I want to use this code. but, there are some problems
I got some errors.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
TVB:91: error: 'TCCR2A' was not declared in this scope
TVB:91: error: 'COM2A0' was not declared in this scope
TVB:91: error: 'COM2B1' was not declared in this scope
TVB:92: error: 'TCCR2B' was not declared in this scope
TVB:92: error: 'WGM22' was not declared in this scope
TVB:105: error: 'TCCR2A' was not declared in this scope
TVB:106: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void setup()':
TVB:190: error: 'TCCR2A' was not declared in this scope
TVB:191: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void sendAllCodes()':
TVB:273: error: 'OCR2A' was not declared in this scope
TVB:274: error: 'OCR2B' was not declared in this scope
please help me. please
August 16, 2012 at 9:56 AM
So nice article
excuse me, but I have some errors.
please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
TVB:91: error: 'TCCR2A' was not declared in this scope
TVB:91: error: 'COM2A0' was not declared in this scope
TVB:91: error: 'COM2B1' was not declared in this scope
TVB:92: error: 'TCCR2B' was not declared in this scope
TVB:92: error: 'WGM22' was not declared in this scope
TVB:105: error: 'TCCR2A' was not declared in this scope
TVB:106: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void setup()':
TVB:190: error: 'TCCR2A' was not declared in this scope
TVB:191: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void sendAllCodes()':
TVB:273: error: 'OCR2A' was not declared in this scope
TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:57 AM
So nice article
excuse me, but I have some errors.
please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
TVB:91: error: 'TCCR2A' was not declared in this scope
TVB:91: error: 'COM2A0' was not declared in this scope
TVB:91: error: 'COM2B1' was not declared in this scope
TVB:92: error: 'TCCR2B' was not declared in this scope
TVB:92: error: 'WGM22' was not declared in this scope
TVB:105: error: 'TCCR2A' was not declared in this scope
TVB:106: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void setup()':
TVB:190: error: 'TCCR2A' was not declared in this scope
TVB:191: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void sendAllCodes()':
TVB:273: error: 'OCR2A' was not declared in this scope
TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:57 AM
So nice article
excuse me, but I have some errors.
please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
TVB:91: error: 'TCCR2A' was not declared in this scope
TVB:91: error: 'COM2A0' was not declared in this scope
TVB:91: error: 'COM2B1' was not declared in this scope
TVB:92: error: 'TCCR2B' was not declared in this scope
TVB:92: error: 'WGM22' was not declared in this scope
TVB:105: error: 'TCCR2A' was not declared in this scope
TVB:106: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void setup()':
TVB:190: error: 'TCCR2A' was not declared in this scope
TVB:191: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void sendAllCodes()':
TVB:273: error: 'OCR2A' was not declared in this scope
TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 9:59 AM
So nice article
excuse me, but I have some errors.
please help me.
TVB.cpp: In function 'void xmitCodeElement(uint16_t, uint16_t, uint8_t)':
TVB:91: error: 'TCCR2A' was not declared in this scope
TVB:91: error: 'COM2A0' was not declared in this scope
TVB:91: error: 'COM2B1' was not declared in this scope
TVB:92: error: 'TCCR2B' was not declared in this scope
TVB:92: error: 'WGM22' was not declared in this scope
TVB:105: error: 'TCCR2A' was not declared in this scope
TVB:106: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void setup()':
TVB:190: error: 'TCCR2A' was not declared in this scope
TVB:191: error: 'TCCR2B' was not declared in this scope
TVB.cpp: In function 'void sendAllCodes()':
TVB:273: error: 'OCR2A' was not declared in this scope
TVB:274: error: 'OCR2B' was not declared in this scope
August 16, 2012 at 10:00 AM
hmm im curious. Would I be able to run this code properly on an arduino lillypad 8Mhz. I ask because I remember in the TV b gone the schematic referenced such an oscillator.
October 25, 2012 at 10:46 PM
This comment has been removed by the author.
October 25, 2012 at 10:46 PM
This comment has been removed by the author.
October 25, 2012 at 10:46 PM
I had the same errors as hippi97, and they went away when I moved the TVB folder out of libraries. Now I have a different error:
avrdude: stk500_getsync(): not in sync: resp=0x00
thanks for your advice,
Hilary
tech@a2zed.us
December 14, 2012 at 11:36 AM
I'm using an adafruit flora , but there isn't a pin 5 ,in it and this is the same code as provided by adafruit. ineed to change the region to EU for south america codes , the circuit looks and works but for the NA , how can i change it?
April 19, 2013 at 11:30 AM
I also tried several different IrLED's but they all do the same.
May 20, 2013 at 4:41 AM
Ken, thanks for all your super hard work on this, and to Mitch Altman and Limor Fried (LadyAda) of course too! I finally got around to making my first ever TV B Gone, which is something I've wanted for over 6 months now! :) Here's a picture:
1) http://bit.ly/1diFnqp
2) http://bit.ly/1pXmoad
Thanks again!
Sincerely,
Gabriel
http://electricrcaircraftguy.blogspot.com/
March 3, 2014 at 4:22 PM
The resistors are of 10K and 47K or 10ohms and 47ohms??
thanks!
September 3, 2014 at 7:48 AM
Could someone do the same but to work on Atmega8A? Is it possible? I've got lots of these. PLEASE
November 10, 2014 at 4:49 PM
i have tested the code and i have some problems :
TVB\WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here
TVB\WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here
TVB\WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes'
WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here
TVB\WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes'
WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
Tested with arduino 1.0.5 for an atmega 168.
November 24, 2014 at 12:57 PM
I try my chance here with not much hope :D
I want to run this on a 12Mhz clock.
I tried changing DELAY_CTN to 11 but it doesn't seem to work.
Would you have any advice on how to i could make it work for such a device (a Pro Trinket 3V/12Mhz from adafruit).
Thanks for sharing that work :) !!
January 10, 2015 at 4:36 PM
This comment has been removed by the author.
February 12, 2015 at 1:18 PM
(referring to these 2 pictures):
My 1st TVBGone, pic1
My 1st TVBGone, pic2
Alex,
if that comment was for me, about the resistors, here's my answer: I can't vouch for that picture with 100% certainty anymore because I made that device a long time ago and have since permanently moved it to a PCB somewhere, but I have since then built another 6 or 8 or so TVBGones (as gifts) and I am most often using the following:
Transistor: 2N3904
R_base = 510 Ohms
R_collector = 10 Ohms
The Arduino I'm using in the picture is a cheapo 5V Pro Mini, and I'm running the regulated 5V to the transistor Collector (though you could probably pull more power and get better IR range if you resized the resistors and ran power straight from the 9V battery to the Collector instead).
My range is ~15 ft. Maybe a touch more if you have good aim.
Sincerely,
Gabriel Staples
http://electricrcaircraftguy.blogspot.com/
February 12, 2015 at 1:25 PM
I am getting a compiling error:
TVB/WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here
TVB/WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here
TVB/WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes'
WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here
TVB/WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes'
WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
What's up?
March 4, 2015 at 5:24 PM
Ken, I want to let you know I have put your code on Github, here: https://github.com/ElectricRCAircraftGuy/TVBGone. This will hopefully make it easier for people to add to it if they wish, or edit it to port to other devices if they wish. I have made only very minor changes to it. I may have changed some pins or something (it was a long time ago I worked on it), and I added debouncing to the button (prob. not necessary, but I did it anyway to be thorough). Anyway, just wanted to let you know. For complete info people can read the readme at my link above.
~Gabriel Staples
http://electricrcaircraftguy.blogspot.com/
March 5, 2015 at 8:47 AM
FYI Everyone, this code will NOT compile in Arduino 1.5.7 or later, due to the newer Arduino IDEs using a newer version of the gcc compiler, which has changed the way progmem is handled. I am using Arduino 1.5.6-r2 Beta to compile and upload this code to my Arduino.
~Gabriel Staples
March 5, 2015 at 8:48 AM
Thanks gabe, please update your code Ken i really wanna make this dope device
March 5, 2015 at 2:13 PM
I keep getting an error saying StructIrCode is already defined or something, even when using the older software. (1.5.2 rev 2 beta). Please help me out with this i need to get this in for science fair asap.
March 5, 2015 at 3:27 PM
Ken, sorry for posting a slightly modified version of your code on GitHub without properly forking it. Somehow I overlooked your GitHub link at the bottom of your article above, or I would have forked from there. In either case, when I get the chance I'll help update to update your root version of the code to make it compatible with the current Arduino IDE, so that will be something I get to sometime.
March 7, 2015 at 5:06 AM
Gabriel, I will be checking this website frequently. Please let me know when you fix the code and how i can access it. Thanks,
Evan
March 7, 2015 at 10:47 AM
Hi ken, im doing the tv b gone and when i compile the project i get this error comment, if u can hlep me, i would be very pleased. Thanks for your time
In file included from main.h:1:0,
from TVB.ino:33:
TVB:78: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TVB:79: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
May 16, 2015 at 3:44 AM
Any fix for:
"undefined reference to 'NApowerCodes'"
... and ...
"undefined reference to 'EUpowerCodes'"
after const has been added?
June 5, 2015 at 10:12 AM
i have got these error codes:
In file included from main.h:1:0,
from TVB.pde:33:
TVB.pde:78:30: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TVB.pde:79:30: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
Error compiling.
can someone help me please?
July 15, 2015 at 8:59 AM
IF YOU GET NAPOWERCODES OR EUPOWERCODES MUST BE CONST,DOWNGRADE YOUR ARDUINO IDE. TEST IT. IT WORKS.
August 30, 2015 at 7:57 AM
Here is a link to the TV-B-Gone sketch which has been corrected and WILL COMPILE/RUN on an Arduino Uno @ 16Mhz, AND BUILDS IN THE NEW ARDUINO SOFTWARE. If you have been an able to build the sketch and run it on your Arduino UNO, TRY THIS -- IT WORKS!
DOWNLOAD HERE:
http://cornfieldelectronics.com/cfe/projects/tvbg_arduino/arduino_sketches/TVBGone_Sketch.zip
The above URL, to that sketch, can be found here:
http://cornfieldelectronics.com/cfe/projects/tvbg_arduino/tvbg_arduino_workshop.php
Just look, on the page, for, "3) You also need the TV-B-Gone Arduino Sketch"
November 28, 2015 at 12:00 PM
I also have the problem of that when I try to compile it broadcasts these errors:
TVB/WORLDcodes.cpp.o:(.progmem.data+0x0): multiple definition of `NApowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here
TVB/WORLDcodes.cpp.o:(.progmem.data+0x112): multiple definition of `EUpowerCodes'
WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here
TVB/WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes'
WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here
TVB/WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes'
WORLDcodes.cpp.o:(.data.num_EUcodes+0x0): first defined here
And can't figure out how to fix them with my limited knowledge of coding, any ideas?
Please help its a cool project but I cant get it to Work.
May 1, 2016 at 1:05 PM
Ok, so now I fixed those errors with a version after 1.5.7, but Im getting diffrent errors like:
In file included from main.h:1:0,
from TVB.ino:33:
TVB.ino:78:30: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TVB.ino:79:30: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
Error compiling.
Please help.
May 1, 2016 at 1:17 PM
Hi all. for those who encountered errors:
i had the same problem with all of you, every few lines some error occurs, after a few hours of playing with the code and the libraries and reading the Ken's method (http://www.righto.com/) of coding for hundreds of times, i found that the problem is not the code itself, I've tried fixing every error, changing every port and finally came to this:
version 1.0.3 (http://arduino.googlecode.com/files/arduino-1.0.3-windows.zip) of arduino IDE for windows, just uploaded it to my UNO R3 without any errors and it works great. i have used no transistors or resistors, just pinned anode of the IR LED to pin 3 and then grounded the LED cathode to GND right next to pin 13. turns every single TV that i have tested so far off, 30 years olds from sony to toshiba and high end samsung TVs.
June 22, 2016 at 11:34 PM
I try your version Amir but i have the same problem :/
June 29, 2016 at 6:06 AM
Ken, please post a link at the top of this article to the latest version of your code, just updated, here.
October 22, 2016 at 4:45 PM
Evan, Marti, Brett, Michel, Joseph, Amir, Mistifyer, and anyone else who couldn't get the code to compile, please see my link just above. I just updated the code on GitHub. Let me know via the GitHub Issues page if you have any problems.
~Gabriel, www.ElectricRCAircraftGuy.com
October 23, 2016 at 3:43 PM
I tried this project a few months ago but came across many of the same errors as the people above.
This new code works excellently and without any problems.
Although I did have a question, inside the new code you give instructions on how to build it:
The hardware for this project uses an Arduino:
Connect an IR LED to pin 3 (IRLED).
Connect a visible LED to the pin 13 (or use the built-in LED in many Arduinos).
Connect a push-button between pin 2 (TRIGGER) and ground.
Pin 5 (REGIONSWITCH) must be left floating for North America, or wire it to ground to have it output European codes.
I was interested in whether there is still benefit to using a transistor and resistor attached to the IR led?
What is your experience?
October 29, 2016 at 3:27 AM
Can I use only microcontroller only of Arduino Uno?
March 17, 2017 at 2:58 AM
Hello
I made your modified project, and it works.
I am in Europe, and the Europe link is in place. Until now, I only try it on my own TV, but sadly it doesn't work on it.
I adjusted the resistor quite low to get a strong power on the IR's leds. They looks to work well (looking with a camera on it)
Will try again on other TV's
The goal going this hack was to be able to shut off TV in front of us, because my 2 years old girl never see TV's and I don't want her to see until older. By the way now our gov. recognize Child under 3 should never see TV, but it's not yet illegal to let them see.
Bring some addition and affect at lot child's brain enhancement.
Thanks a lot for your work. Previous versions were not possible anymore to use on arduinos !
March 31, 2018 at 3:48 PM
Great! Thank you! Worked perfectly on a SONY TV.
Also, thanks for, #mutiemouse note:
"Just a note for Mega users, use pin 9 instead of 3 for connecting of the LED driver circuit. Also change "#define IRLED 3" in "main.h" to 9." (before that change it did not work on the Arduino Mega Board I have)
September 11, 2020 at 10:37 AM
Where is the code?
November 28, 2021 at 11:18 PM