# 2 digit 7 segment display

**URL:** <https://discourse.nodered.org/t/2-digit-7-segment-display/27877>\
**Category:** General\
**Created:** [6 June 2020 03:55 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877 "2020-06-06T03:55:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PommyBitter](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@PommyBitter](https://discourse.nodered.org/u/PommyBitter)\
**Post date:** [6 June 2020 03:55 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/1 "2020-06-06T03:55:53Z")

</div>

Hello all,  
First off I'm a newcomer to node red and so far I love it. Still learning but operating on a basic level so far.  
I'm trying to output temperature to a 2 digit 7 segment display. I've found a node (7 segment decoder) which controlled each segment of the 7 segments individually, However this is only for a single 7 segment display!

I have a 2 digit seven segment but can't find any nodes to drive a 2 digit seven segment.

I've worked out how to interface with a BCD to the 7 segment (to reduce GPIO's used) and setup a 2 x diodes to drive to ground (common cathode display) to enable either the 1st of 2nd digit of the display but I simply don't have the code behind it.

any help is appericated...but please keep the language simple as I'm just learning.

thanks in advance.

---

<div class="post-metadata">

**Author:** ![PommyBitter](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@PommyBitter](https://discourse.nodered.org/u/PommyBitter)\
**Post date:** [6 June 2020 03:57 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/2 "2020-06-06T03:57:36Z")

</div>

Thought I'd post the 7 segment decoded I do have:

var on = { payload: 1 };  
var off = { payload: 0 };

if (msg.payload == 1) {  
return [on, off, off, off, on, on];  
} else if (msg.payload == 2) {  
return [off, on, off, off, on,off];  
} else if (msg.payload == 3) {  
return [on, on, off, off,on];  
} else if (msg.payload == 4) {  
return [off, off, on, off,on];  
} else if (msg.payload == 5) {  
return [on, off, on, off,on];  
} else if (msg.payload == 6) {  
return [off, on, on, off,on];  
} else if (msg.payload == 7) {  
return [on, on, on, off,on];  
} else if (msg.payload == 8) {  
return [off, off, off, on,on];  
} else if (msg.payload == 9) {  
return [on, off, off, on,on];

} else if (msg.payload == 0) {  
return [off, off, off, off,on];

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 June 2020 09:16 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/3 "2020-06-06T09:16:38Z")

</div>

I don't use the Arduino node or any Arduino's, so i will need more info to help you.  
Are the 7 segment displays on different pins?  
If so how does the Arduino node determine which pin to target?

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [6 June 2020 09:19 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/4 "2020-06-06T09:19:21Z")

</div>

I didn't see any mention of Arduino in the question.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 June 2020 09:22 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/5 "2020-06-06T09:22:13Z")

</div>

My mistake i looked at the 7 segment flow and saw Arduino.

I would then need to see what node you are using to connect to BCD.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 August 2020 09:22 UTC](https://discourse.nodered.org/t/2-digit-7-segment-display/27877/6 "2020-08-05T09:22:14Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
