If not using the dp in a seven segment display one has to "connect" it but then turn it off if it is not required in the macro.
So, if one wants to use this pin for another purpose, how does one go about it.??
dp in 7 segment display
Moderator: Benj
-
- Flowcode v5 User
- Posts: 17
- Joined: Mon Sep 16, 2013 3:04 am
- Been thanked: 1 time
-
- Flowcode v5 User
- Posts: 17
- Joined: Mon Sep 16, 2013 3:04 am
- Been thanked: 1 time
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: dp in 7 segment display
Hello,
The 7seg component requires a pin to drive the decimal point and assumes that this is what you will be using it for. I think there will likely be a compile error if you do not assign a connection to the pin but what about if you use a pin which is already assigned to one of the anode or cathode pins? This may not work perfectly but may give you a workable solution leaving your other pins free to do what you like with.
Here is the v5 C code you could override to switch off the DP pin.
ShowDigit function
The 7seg component requires a pin to drive the decimal point and assumes that this is what you will be using it for. I think there will likely be a compile error if you do not assign a connection to the pin but what about if you use a pin which is already assigned to one of the anode or cathode pins? This may not work perfectly but may give you a workable solution leaving your other pins free to do what you like with.
Here is the v5 C code you could override to switch off the DP pin.
ShowDigit function
Code: Select all
//if (cSegmentValue & 0x80)
//{
// FC_CAL_Bit_High_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
//}
//else
//{
// FC_CAL_Bit_Low_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
//}
......
//if (cSegmentValue & 0x80)
//{
// FC_CAL_Bit_Low_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
//}
//else
//{
// FC_CAL_Bit_High_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
//}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode v5 User
- Posts: 17
- Joined: Mon Sep 16, 2013 3:04 am
- Been thanked: 1 time
Re: dp in 7 segment display
It does not get as far as a compile error.
I do not see the need to do a c code.
It simply will not accept that the dp pin is left disconnected in the "connections".
It will however allow turning it on or off in the macro as i explained earlier but it appears cannot be used other than that.
Ok..thanks.
I do not see the need to do a c code.
It simply will not accept that the dp pin is left disconnected in the "connections".
It will however allow turning it on or off in the macro as i explained earlier but it appears cannot be used other than that.
Ok..thanks.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: dp in 7 segment display
Hello,
If you attach your Flowcode program then I will do some minor edits to remove the DP functionality by customising the C code embedded in the 7-seg component in your project.
If you attach your Flowcode program then I will do some minor edits to remove the DP functionality by customising the C code embedded in the 7-seg component in your project.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel