X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: zenwarrior on September 19, 2008, 05:11:45 PM

Title: Timer count-down?
Post by: zenwarrior on September 19, 2008, 05:11:45 PM
New to this, but am curious whether it is possible to send a signal to the mini-timer to do a countdown and then turn off power to the device it's connected to?  I.e. I want to log people into XBox stations via a script and show them the amount of time they have left then shut off power to the TV when the timer reaches 0.  Is this possible or not?
Title: Re: Timer count-down?
Post by: kyleg on September 19, 2008, 08:09:22 PM
not sure if that minitimer is programmable by PC (or seen by PC time left wise. I would think, you would just want your form or program to start a timer and then send the off signal to appropriate line. I am hoping to find out the trigger method too as I am a newbie. I made a post about the triggering in the tread below yours but have not got a response code wise....but I was asking for VB script. I did get a response about using a bat file ....maybe that will work for you? What language are you trying to do this in?

Regards
Kyle
Title: Re: Timer count-down?
Post by: Brian H on September 20, 2008, 07:05:21 AM
Both the older MT10 and LCD MT12 Minitimers are controllers only. They are manually set to send on and off commands at the set times to X10 modules.
They can not be remotely programmed and have no controlled outputs to turn things on and off.
Title: Re: Timer count-down?
Post by: EL34 on September 20, 2008, 07:46:50 AM
Code: [Select]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         ' 60000 = 1 minute
         Timer1.Interval = 60000
         Timer1.Enabled = True
     End Sub

 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        *** Do here, whatever you do at the end of the timer1 countdown ***
    End Sub

If you write software, you just do it in your program.
This is a Visual Basic example
You have to add Timer1 to your VB form first in VB 2008 express
After the timer ticks down to zero, the program executes the code in the Timer1_Tick  sub

You would have to have multiple timers if you were timing more than one event.