Help with sensor problem
Lone_husky
Posts: 13
Hi there,
I'm using the BS sx to measure the light coming from a TSL230 light to frequency converter.· I need to detect the transition from high signal to low signal but sometimes the reverse is true.· I thought about using a differential and have been successful in calculating it but cannot use it as both positive and negative.·
How do I use a negative integer with a conditional statement to signify the transition from one state to another.
I have also tried using the levels themselves but there is too much variablity.
Any advice
-V
I'm using the BS sx to measure the light coming from a TSL230 light to frequency converter.· I need to detect the transition from high signal to low signal but sometimes the reverse is true.· I thought about using a differential and have been successful in calculating it but cannot use it as both positive and negative.·
How do I use a negative integer with a conditional statement to signify the transition from one state to another.
I have also tried using the levels themselves but there is too much variablity.
Any advice
-V
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
as in
XSIGN = 1
IF XVAL&32768 THEN··········· ' is it negative
···· XSIGN = 0
···· XVAL = (XVAL^65535)+1· ' two's complement
ENDIF
You would use 128 and 255 for byte values, of course.