Pages: [1]   Go Down
Author Topic: IR code - activation program  (Read 151 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I'm a beginner on using the arduino. I have an arduino uno and have managed to build and modify simple circuits. I need to build a program which uses IR. I have downloaded the IR library and started experimenting. Till now I have only managed to push a button on the remote and an led is lit.

My main issue is that, I want my arduino to light up the led after a series of buttons are pressed in a particular sequence. For example 1852 and the led lights up. If the sequence is wrong, I want it to refresh the sequence. Also I would like it to refresh the sequence every 10 seconds so if part of the sequence is entered well, and time has passed, the sequence will have to be entered from the beginning.

What kind of method should I use? 

I appreciate if you help me smiley

Manuel
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What kind of method should I use? 
An array to hold the values and millis() to notice when a new value is entered, and what time it is now. The difference between then and now will define whether to reset the array index or not.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Inventor artist maker hacker social-geek. Parol Lanterns, Rubber band planes, drawing-painting robots, CNC laser, 3D printing, CNC, arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, why not read the incoming codes into an array.

First check if the code is in your list of valid codes, then load it into an array.

Each time you load a code into the array, compare the array to the codes that trigger actions.

When you get a match, take the action and clear the array.

Logged

inventorArtist.com

Pages: [1]   Go Up
Jump to: