Giter VIP home page Giter VIP logo

arduino-tv-b-gone's Introduction

README.md update history:

Readme Last Updated: 22 Oct. 2016
By Gabriel Staples, http://www.ElectricRCAircraftGuy.com
-My contact info is available by clicking the "Contact Me" tab at the top of my website.

Current Code Version & History:

-see Arduino_TV_B_Gone.ino for full version history

Semver (http://semver.org/) VERSION HISTORY (newest on top):
(date format: yyyymmdd; ex: 20161022 is 22 Oct. 2016)

  • 20161022 - v1.3 - Semver versioning implemented; various code updates, clarifications, & comment additions, and changes to fix PROGMEM incompatibilities so it will now compile with latest versions of gcc compiler; also improved blink indicator routines & added the ability to stop the code-sending sequence once it has begun; by Gabriel Staples (http://www.ElectricRCAircraftGuy.com)
  • 20101023 - v1.2 - Latest version posted by Ken Shirriff on his website here (http://www.righto.com/2010/11/improved-arduino-tv-b-gone.html) (direct download link here: http://arcfn.com/files/arduino-tv-b-gone-1.2.zip)
  • 20101018 - v1.2 - Universality for EU (European Union) & NA (North America) added by Mitch Altman; sleep mode added by ka1kjz
  • 2010____ - v1.2 - code ported to Arduino; by Ken Shirriff
  • 20090816 - v1.2 - for ATtiny85v, by Mitch Altman & Limor Fried (https://www.adafruit.com/), w/some code by Kevin Timmerman & Damien Good

Description:

This code is the TV-B-Gone library ported to run on the Arduino.

Background:

-see Arduino_TV_B_Gone.ino for latest version history & more details.

Updated code to fix PROGMEM incompatiblities--now works with latest versions of gcc compiler & Arduino IDE -with other improvements also By Gabriel Staples (http://www.ElectricRCAircraftGuy.com)

This port to Arduino is by Ken Shirriff.
For background details on the Arduino port, how to build it, and how to use it, see:

For information on the original TV-B-Gone see:
http://www.tvbgone.com/. Mitch Altman is the inventor of the original TV-B-Gone.

The original code is:
TV-B-Gone Firmware version 1.2
for use with ATtiny85v and v1.2 hardware
(c) Mitch Altman + Limor Fried 2009
Last edits, August 16 2009

Added universality for EU or NA, and Sleep mode to Ken's Arduino port.
-- Mitch Altman 18-Oct-2010
Thanks to ka1kjz for the code for adding Sleep
http://www.ka1kjz.com/561/adding-sleep-to-tv-b-gone-code/

With some code from:
Kevin Timmerman & Damien Good 7-Dec-07

License:

Distributed under Creative Commons 2.5 -- Attribution & Share Alike

CIRCUIT:

-NB: SEE "main.h" TO VERIFY DEFINED PINS TO USE
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.

User Manual:

Background Settings:

  • The TV-B-Gone for Arduino can use either the EU (European Union) or the NA (North America) database of POWER CODES
  • EU is for Europe, Middle East, Australia, New Zealand, and some countries in Africa and South America
  • NA is for North America, Asia, and the rest of the world not covered by EU
  • Let pin 5 float for NA codes, or wire it to ground to have it send EU codes
  • Serial debugging output can be activated by setting "DEBUG 0" to "DEBUG 1" in "main.h"
  • For 8 MHz Arduinos, define DELAY_CNT as 11 in "main.h," or use 25 for 16 MHz Arduinos.
  • Fine-tune if necessary
  • All IR codes are defined in "WORLD_IR_CODES.h"
  • We'd love to have you add more! Just be careful NOT to duplicate codes please!

Use:

  • When the device is first powered on, it will quick-flash (30ms on-time followed by 250ms off-time) 3 times if set to output NA (North America) codes, or 6 times for EU (European Union) codes. See the end of the "setup()" function.
  • Once on, the device will enter sleep mode, where it will remain until a button press occurs on the TRIGGER pin, at which point it will wake up and send all of its power codes for the region set according to the state of the REGIONSWITCH pin.
  • Once you press the TRIGGER button (on pin 2), all power codes will be sent sequentially, one after the other. Note that the trigger button debouncing is done in a very primitive fashion, so quick button presses and releases (<500ms) may work best. If you just hold down the button, the code sending sequence will be continually started, stopped, and started again, since a button press during code sending is used to stop the sending sequence.
  • After each individual IR power code is sent, a quick flash will occur on the visible LED (30ms on-time) to indicate a code was just sent. Therefore, as the codes are sent, you will see the visible LED flash repeatedly.
  • Once all codes have been sent (which takes around 60 sec or so), a ~1.3 sec pause followed by 8 quick flashes will occur to indicate that all power codes have been sent. Then, the device will go back into sleep mode until another TRIGGER button press occurs.
  • Between individual power codes, the TRIGGER button is read one time. If it is read as pressed (LOW), the code sending sequence will be stopped early. This will be indicated by a ~705ms delay followed by 4 quick-flashes, followed by another ~1.3 sec delay to give you time to release the button.
  • NB: since the TRIGGER button is only read between individual codes, rather than continuously, you may need to hold down the button for a half-second to second or so for it to be read properly as pressed. Once the delay and 4 quick-flashes begin, you can release the button, and the power codes will be stopped. The device will enter back into sleep mode. Press the button again to begin the code sequence again from the beginning.
  • NB: If you keep holding the button, however, this will be read as a new button-press in the main loop and the sequence will be restarted. Therefore, continually holding the button will just keep starting and stopping and starting again the sending sequence, repeatedly.

arduino-tv-b-gone's People

Contributors

electricrcaircraftguy avatar shirriff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-tv-b-gone's Issues

Compilation Error for Flora

Working on a solution but still I get this error:

error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of 'attribute((progmem))'
const struct IrCode *NApowerCodes[] PROGMEM = {

Error on Debug output

Error on line 293 of the .ino
//DEBUGP(uint16_t x = (freq+1) * 2; // original error
Must be :
DEBUGP(uint16_t x = (freq+1) * 8; // Invert freq_to_timerval function and print 35 to 40 Khz carrier frequency as it should

But, the TV B Gone does'nt anything on my Sony TV, the IR is 940 nm, i should verify

Doesn't compile on recent versions of avr-g++

Hi! First, this is great. Thanks for porting this code :) But there is an issue. When I try to compile this using either avr-g++ 4.7.3 on ubuntu 13.10 or avr-g++ 4.8.something on fedora 20, I get the following error:

In file included from main.h:1:0,
             from WORLDcodes.cpp:12:
WORLDcodes.cpp:8506:37: error: variable 'NApowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 const struct IrCode *NApowerCodes[] PROGMEM = {
                                 ^
WORLDcodes.cpp:8646:37: error: variable 'EUpowerCodes' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 const struct IrCode *EUpowerCodes[] PROGMEM = {
                                 ^

It works flawlessly when I downgrade to avr-g++ 4.5.3.

LG TV issue

I have facing troubles with LG TV in Brazil. It doesn’t work. Someone knows what is its code?

Index exceeding limits for code_na007Code

Hi, When I printed the timing info I observed that for "code_na007Code" the ti is exceeding the limits of "code_na007Times". I cannot fix as I don't have original timing sequence.

IR codes updates?

It appears that over time the v1.3 code works with fewer and fewer TVs - what is the best available resource to find updated IR codes for new makes/models?

Thank you!

won't compile & run with ATtiny 85

Hello folks!

I tried to compile this code for ATtiny85 with Arduino IDE 1.8.19.

The first issue was, that some variables weren't defined. After defining them in the ino-file,
#if BOARD == ATTINY85 int TCNT2, COM2A0, COM2B1, TCCR2A, TCCR2B, OCR2A, OCR2B, WGM20, WGM21, WGM22, CS21; #endif
the compiling process seemed to be okay.

But then the linker told me, that the code would use 2k more space than the 8kB, the microcontroller can deliver.
So, I reduced the IR code database for NA const IrCode* const NApowerCodes[] PROGMEM =, by just commenting many lines out in WORLD_IR_CODES.h.
Now I can compile the program and burn it via ISP into my ATtiny85. The chip seems to be doing something, but it isn't generating always valid IR codes. I tested this with an JOY-IT multi tester, that can detect and decode IR signals.
Yes, I told the ATtiny85 to run with 16MHz(PLL) by first burning a optiboot bootloader. The code after compilation was uplaoded without bootloader, of course. The standard LED is flashing and it seems to behave the same, as on the Arduino nano.

So, why don't these both boards behave the same way? Are the variables above not used as INT? Does the ATtiny85 have another timing problem? Does the avr-gcc do different things for the 328P on the nano board and the ATtiny85 chip?

Does anyone have an idea?

If someone will need to inpect the code, I'll create an upload link, cause I'm not really familiar with GIT.

Best regards,
Thomas

Compatibility with different projects

@shirriff Is there a way to do something like include this in another project as a library or something? Like, instead of having to integrate this into one's project, one could just call the method of this repo from the main code. (I hope that made sense :D)

No longer seems to be working

I have tried it on Ardunio Nano and various Pro Mini boards and none of them seem to be working properly.

Not sure exactly what the issue is but I think it has something to do with timing. If I change default from 25 to 29 it sends some valid IR signals but not all of them are vaild.

I have been using my Flipper Zero to check the IR signals generated and it is only sending maybe 10% valid IR signals when the timing is set to 29 otherwise it doe not send any valid signals.

I wonder if it is due to changes to the IDE or something else causing the issue?

Has anyone recently been successful in getting the TV-B-Gone to work?

Does not support attiny85-based Arduino compatibles

This project uses timer2 (presumably for PWM for IR output in xmitCodeElement), which is not available on the ATTiny85. This means that it will not run on Arduino-compatibles based on the attiny85.

One workaround could be to outsource the IR output to something like the IRRemote library, which does support ATTiny boards.

Specifically, I was trying to run this on this Adafruit Trinket.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.