ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#22693 - 09/29/11 03:39 PM Question about a Ocelot Program
Nettec Offline
newbie


Registered: 09/29/11
Posts: 1
I am trying to setup a program so that to runs on the boot up of the Ocelot from the mains power. Is there a way to do that?
Id like to set a timer to start when the unit powers up and then 60 seconds later start excuting commands.

We are setting up a system to automatically turn on a series of TVs and issue IR commands.

Thanks for your help

Top
#22694 - 09/29/11 04:40 PM Re: Question about a Ocelot Program [Re: Nettec]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Yes you can do that. Just use a variable as a flag. Since non-volatile variables are set to 0 when powering up, use a code section at the beginning to skip over your entire code until the flag is set to 2, like this:

IF Variable #1 = 0 //if set to 0
THEN Timer #1 = 1 //start timer
THEN Variable #1 = 1

IF Timer #1 becomes > 60 //60 seconds later
THEN Timer #1 = 0 //stop timer
THEN Variable #1 = 2 //normal running state

IF Variable #1 is NOT = 2
THEN Skip to (highest line number you have)



get the idea? The thing about setting variable #1 to 1 initially is to avoid having the first two lines restarting the timer over and over.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 62 anonymous users online.
Recent Posts
Ocelot not working
by JPO
11/08/17 06:02 AM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4004 Topics
23442 Posts

Max Online: 132 @ 11/13/16 10:07 AM
November
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30