Results 1 to 2 of 2

Thread: Logic problem

  1. #1
    Variable Bitrate
    Join Date
    Aug 2006
    Central PA

    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 Images Attached Images  
    Attached Files Attached Files
    Last edited by scotty562; 03-18-2011 at 10:41 PM. Reason: Added config

  2. #2
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Colorado, but Canadian!
    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

Similar Threads

  1. RR logic statements
    By ACCLR8N in forum Road Runner
    Replies: 6
    Last Post: 10-26-2010, 09:20 PM
  2. Logic Issue
    By bratnetwork in forum Fusion Brain
    Replies: 3
    Last Post: 03-01-2010, 09:40 PM
  3. logic analyzer
    By ITL in forum General Hardware Discussion
    Replies: 2
    Last Post: 09-11-2004, 11:03 AM
  4. know what a logic analyzer is? please help
    By ITL in forum LCD/Display
    Replies: 2
    Last Post: 09-10-2004, 09:24 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts