Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: counter Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: October 26 2004 at 19:52 | IP Logged Quote mustangcoupe

Hi Guys.... tried to post this past weekend and had server problems.. so this may be too short notice. I just dont know where to start with this.. I have PH and a x10 5-1 remote.. I want ph to "count" the on (+1) and offs (-1) of a A-5 signal. what I want to do is count the kids that come by for trick ot treat this weekend. anyone done this or give me some code to do it???

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: October 26 2004 at 21:22 | IP Logged Quote TonyNo

You want to be able to subtract from the count, too?

Create a global variable called COUNT.

Add a trigger for X-10 RF In, A5, On as Formula...

ph_setglobal_a ( "COUNT", {COUNT} + 1 )

Add a trigger for X-10 RF In, A5, Off as Formula...

ph_setglobal_a ( "COUNT", {COUNT} - 1 )

Done deal! Let me know if you need more.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 27 2004 at 13:15 | IP Logged Quote dhoward

Todd,

Tony has you covered. I had to think awhile about your request and Im still not sure what the difference is between the A5 on and A5 off but if you want to count them both, you'll need two global variables instead of one...say COUNTON and COUNTOFF. You can just modify Tony's sample above substituting COUNTON and COUNTOFF appropriately.

Also, be sure you pre-initialize your global variables with 0 so the counts work properly.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: October 28 2004 at 15:25 | IP Logged Quote mustangcoupe

I can just figure that I would "accidently press the button" or my wife will play with it... LOL

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: October 28 2004 at 21:38 | IP Logged Quote mustangcoupe

works great! But can I program the formula to also speak TTS the value of count after it adds the value to it?

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: October 29 2004 at 06:51 | IP Logged Quote TonyNo

Just add this to the end of the formulas...

[plus] ph_tts("{COUNT}")

Replace [plus] with an actual plus sign. How did I get it to show up in my last message?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: October 29 2004 at 06:59 | IP Logged Quote mustangcoupe

maybe because it was not the first char in the line

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum