ElectroLund

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Colorado

ElectroLund's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Wait, I think I got it fixed. If I simply remove the function name (LampCheck) at the top of the LampCheck sequence, and then call the sequence from the button, then I see the two sequences running concurrently.
  2. your ctl file is for a newer version. Mine is... older.
  3. Thanks, I resolved by splitting those functions into separate sequences. So now I have a helper sequence: function LampCheck() while (1) //-------------------- // check the lamp current pin LampCurrent() // check the lamp power pin LampPower() //-------------------- // now process the results // GPIO 1 GPIO 2 if (lampCurrent[0] == 0 && lampPower[0]) == 0) ? "Power not available/disconnected" v.lampStates.AddValue(-1) elseif (lampCurrent[0] == 0 && lampPower[0]) > 435) ? "Power available, lamp not connected" v.lampStates.AddValue(-2) elseif (lampCurrent[0] > 205 && lampCurrent[0] < 270 && lampPower[0]) > 435) ? "Power available, lamp off" v.lampStates.AddValue(0) elseif (lampCurrent[0] > 270 && lampPower[0]) > 435) ? "Power available, lamp on (flashing)" v.lampStates.AddValue(1) else ? "Other combinations wouldn’t be valid" v.lampStates.AddValue(-3) endif ? v.lampStates[0] //-------------------- // critical delay! delay(0.3) // execute 3 times a second endwhile This needs to run a couple times a second once started, parallel to the calling sequence. I understand this is a call for (pun) the BeginSeq() command. So here's a sample caller sequence: beginseq(LampCheck) ? "started sequence" Delay(.8) ? "delayed 0.8 seconds" Delay(1.4) ? "delayed 1.4 more seconds" endseq(LampCheck) Yet when I start this caller sequence, it is getting stuck in the LampCheck. The two sequences aren't running concurrently.
  4. I'm unable to call a specific function from inside a sequence page from a control button. I would prefer to organize my functions that are related in a single sequence page. What am I doing wrong?