No announcement yet.

Logic problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • Logic problem

    Hi guys. I have 3 sensors at the moment. They are all the same thing wired the same way. Sensor 0, sensor 1 and sensor 2. If sensor 1 is > sensor 2 digital output 0 is turned on and digital output1 is turned off. If sensor 2 is > sensor 1 digital output 1 is turned on and digital output 0 is turned off.

    This all works just fine.

    Now I'm trying to add a third sensor into the mix. If sensor 1 minus sensor 0 < 15 then turn off digital output 0 and 1. If sensor 2 minus sensor 0 < 15 then turn off digital output 0 and one. There is a calculation done on the analog input but this is the basic idea. I have my priority set higher for this than I do for the first paragraph.

    When I run this the logic block for the third sensor doesn't work. Even if sensor 1- sensor 0 is < 15 is still turns the digital output on.

    The attached image will help explain my sensor 0 logic block. I can post up my code if need be


    Added config as txt file since I can't upload xml.
    Attached Files
    Last edited by scotty562; 03-18-2011, 09:41 PM. Reason: Added config
    2001 SS Camaro carputer | My solar dish project/

  • #2
    Logic is good, but your then statements are wrong.

    I looked in the config file briefly and your first two statements correctly turn the outputs on and off. However the 3rd and 4th then statements enable and disable buttons, and do nothing to the actual outputs. So it is acting as planned. When the logic is true, your button should no longer be clickable as you have it now.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the Store