
steve.neal
Australia
Asked
— Edited
I just want to confirm, so as to NOT release the magic smoke, I want to trigger scripts wit the press of a button or the closing of a normally open contact. I figure that I connect the Red (3.3 Volts) and White (signal) on an ADC port across the switching contacts and have a script watching the assigned ADC port for change. I also planned to connect a pull down resistor across the signal to ground to keep floating voltages in check.
Is the above correct?
Also I may need a little help with scripting, How do I wright a script to watch and wait until the contact is closed, or opened again for that matter? I need the script to pause the personality generator at least and then I can build on it from there.
Thanks for any help in advance
Steve
When you loop your script make sure you place a Sleep() command in there or you'll overwhelm your system and everything will come to a stop. The longer the pause the better and still have a quick enough responce for your taste. Try starting out about 0250 or less and work up from there. You my find a full second may seem like a sluggish responce when you push your button. Here's one of my scripts I use to toggle the personallity generiotr on and off when pushing a momentery button attached to an ADC port. Perhaps it could be written better but it seems to work nice for me with no problems:
I loved Queensland when I was there a few years back. I spent a couple days scuba diving the Great Barrier Reef off of Mackay from a catamaran. I understand why it's one of the wonders of the world now. I actually slept on the beach one night and watched the stars and listened to the ocean. The month I spent in your country was one of the best of my life.
Lots of stories to share but this is kinda off topic. Forgive me. Can't help it. I have to talk about my time with your people down under when I get a chance.
Thanks for all your help Dave
No need for apologies, go off topic any time you want. I scuba dived at the Great Barrier Reef too some years back, incredible springs to mind. Never slept on a beach under the stars though...sounds awesome
Catch ya soon mate
Steve
GetADC( Port ) Returns the 8 Bit ADC value of the specified port Example: $x = GetADC(adc0)
I am having trouble with the above as I cant seem to figure out how to nominate which EZB board I am using. I have 2 EZBs and I want to monitor Port 0 of Board 1. I know the (adc0) refers to port 0 but how do I tell it to use board 1
Steve
From the EZ-B script manual:
So, for your example it would be $x = GetADC(1.adc0)
Alan
Actually Alen $x = GetADC(1.adc0) would be the 2nd EZB . The first EZB would be zero (0). You don't have to state that board. you would just write it like Steve shows it: GetADC(adc0)
Thanks guys, I think I tried nearly everything. The only difference between one of my many, many failed combinations and yours was I had a comer between the 1 and adc instead of a full stop. I will give that a try
Steve
yeah, I assumed he knew that board 1 is the second board because he specifically referenced it, and since I quoted the EZ-B manual section that explains the board numbering, but in case my assumption was wrong, yes, if you don't specify a number, it will choose board 0, the first board.
Alan