Pages: [1]   Go Down
Author Topic: A simple TV remote control for Granny. Part two.  (Read 921 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 2
Posts: 42
Instant Karma
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just add this after part one.

(Here's the link to part one    http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1283692181). Should have added it earlier. :-[
Code:
void sendOne() {
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1160);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);        
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}

void sendTwo() {
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);        
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}

void sendThree() {
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1160);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}

void sendFour() {
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);        
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}

void sendZero() {
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}

void sendLeader() {
sendHF(360);                  // *** 8.8 mS. Value determined by observation ***
  digitalWrite(ledPin, LOW);
  delayMicroseconds(4640);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(1740);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
sendHF(21);
  digitalWrite(ledPin, LOW);
  delayMicroseconds(580);
}
« Last Edit: September 05, 2010, 02:39:52 pm by Selby96 » Logged

Southern Ontario
Offline Offline
Sr. Member
****
Karma: 2
Posts: 279
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why don't you reply to your first post, so everything is contained in one single thread?  Otherwise you will have comments in both threads, and it just makes things a big mess!

Nice work though, although I am unsure as to the purpose of the diodes on the buttons, in my (limited) experience, that would only really be required if you had them in a matrix of some sort.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7307
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Great project and yeah very nice of you to have done this for your mother-in-law. Where did you buy those oversided buttons? Will you upload a video or maybe some feedback from your spouse and the in-laws? Seems to be something I could do as well.
Logged


0
Offline Offline
Newbie
*
Karma: 2
Posts: 42
Instant Karma
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I got the keypad here http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1774829.

Quote
Will you upload a video
A video would be short and not very interesting.   ;D

Hyacinth insists on living on her own, and is delighted with the remote as she finds it much easier to use than the manufacturers remote, which was the whole idea.

Quote
Seems to be something I could do as well.
Of course you could. I built the (few) components on stripboard, and stuck the pcb and battery holder in the box with double-sided pads. The keypad connects with a standard header strip. I salvaged the IR diode from a defunct remote.
Logged

Pages: [1]   Go Up
Jump to: