Go Down

Topic: A simple TV remote control for Granny. Part two. (Read 959 times) previous topic - next topic

Selby96

Sep 05, 2010, 03:12 pm Last Edit: Sep 05, 2010, 09:39 pm by Selby96 Reason: 1
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: [Select]
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);
}

nickvd

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.

liudr

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.

Selby96

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.

Go Up