Page 1 of 1

LED 7segment blanking and negative numbers possible?

Posted: Tue Jul 22, 2008 10:35 am
by rstechnics
Hello,
for a new project i need to display an actual temperature value on the 4x 7Segment display E-block.

For normal positive values this is working fine:
the integer-variable Actual_TEMP is separated in 4 digits (by the MOD/100 etc. lines) and then via an TRM0_INT send and multiplexed to the LED-display using the LED7SEG4(0) macro's SHOWDIGIT subsequently for all 4 display''s.

Questions:
1. When the value of Actual_TEMP goes negative, temperature below 0Β°C, the display starts showing wrong values.
In wich way is it possible to give a minus '-' symbol at the most left Display with the actual temperature on the 3 other display's, like "-10" Β°C

2. Is it possible to give 4 '-' minus symbols on all 4 display's "----" in an Overload situation?

3. How can i blank out (temporarely) one or more display's?
This for blanking out the leading zero's etc., displaying " 10" Β°C in stead of " 0010" Β°C

many thanks in advance for your reaction,
kind regards, Luuk Aalders
(RS Technics BV - The Netherlands)

Re: LED 7segment blanking and negative numbers possible?

Posted: Tue Jul 22, 2008 1:02 pm
by Benj
Hello

In answer to your questions.

1) You can do a initial compare to see if the input value is less then 0. If the value is less then 0 then show the first digit as the minus sign and then convert the number back to a positive by subtracting the negative value from 0.

2) Yes the minus symbols can be showed by writing values directly to the port. The particular anode will need to be set and the cathodes that are off also need to be set. Cathodes that are on should be cleared. You can do this using 2 output icons, 1 for the anode port and 1 for the cathode port.

3) Simply include a decision in your interrupt routine that doesnt show the first two digits etc if a flag is given the value 2 etc. The value of 2 can be set when the number is converted to 4 individual digits.

Hope this helps.

Re: LED 7segment blanking and negative numbers possible?

Posted: Sun Oct 23, 2011 10:02 pm
by Creative25
Hi there.
I am trying to display negative numbers on a seven segment display.
I get it right do make a minus sign.
Do not quite understand how to test and convert the Number. Do you put an if "<0" in a decision box to see if the number is negative and then make a calculation?
The other question can I put a negative number into a decision box?

Re: LED 7segment blanking and negative numbers possible?

Posted: Mon Oct 24, 2011 3:38 pm
by Benj
Hello,

Only the INT variable type in Flowcode can go negative.

Using this in a decision to detect if a number is negative will work fine.

e.g. var < 0

You can also put negative numbers in the decision icon.

e.g. var = -25

Re: LED 7segment blanking and negative numbers possible?

Posted: Wed Oct 26, 2011 4:57 pm
by Creative25
Hi Benj
Thanks for the Advice,
the minus numbers are showing correctly now.

First it did not work until I put a separate variable for the calculation.
First i had the following calculation.
Temp= 0-Temp
This made the the number to continuously convert from negative to positive and then back to negative.
So I put a new variable
Tempdisp= 0-Temp
Now it works perfectly.

I put the calculation into the refresch interrupt for the 7 segment display is that the right way to do it?

What happened to the thanks button on the website?

Best Regards:
Uli

Re: LED 7segment blanking and negative numbers possible?

Posted: Thu Oct 27, 2011 1:10 pm
by Creative25
Hi there,
I am answering my own question.
I had to remove the calculation from the Interrupt, or else it Gives an error message.

Regards:
Uli