# Pot display number on seven segment display

**URL:** <https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488>\
**Category:** Uncategorized\
**Created:** [December 4, 2018, 11:28pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488 "2018-12-04T23:28:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmskipsey](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@cmskipsey](https://forum.xod.io/u/cmskipsey)\
**Post date:** [December 4, 2018, 11:28pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/1 "2018-12-04T23:28:36Z")

</div>

Trying to do a very simple experiment: display the digit 0-9 on a single seven segment display based on input from pot.

Display works fine. I’ve mapped pot via a map node - values as follows:  
Smin 0.0  
Smax 1.0  
Tmin 0  
Tmax 9

Using [https://xod.io/libs/marcoaita/malibrary/seven-segment-in-xod/](https://xod.io/libs/marcoaita/malibrary/seven-segment-in-xod/) node for the display. Mapping output directly into num of display node.

It displays 0 and 9 ends of the map, but only briefly displays 3 and 6 in between, and requires you to very precisely stop the pot to even display those numbers.

Is there something going on with the way the data is refreshed? Frustrating because this should be a simple experiment!

And help appreciated

Cheers

Craig

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [December 4, 2018, 11:31pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/2 "2018-12-04T23:31:37Z")

</div>

Sounds like you are trying to display a floating point number as a single digit. There should be a floor or rounding node that would convert to integer for you

---

<div class="post-metadata">

**Author:** ![cmskipsey](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@cmskipsey](https://forum.xod.io/u/cmskipsey)\
**Post date:** [December 4, 2018, 11:33pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/3 "2018-12-04T23:33:23Z")

</div>

Doesn’t the map node do that for me? Eg 0.16 -\> 2  
0.41 -\> 4  
Etc

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [December 4, 2018, 11:33pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/4 "2018-12-04T23:33:43Z")

</div>

Test placing `floor` between `map` and `display`

---

<div class="post-metadata">

**Author:** ![cmskipsey](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@cmskipsey](https://forum.xod.io/u/cmskipsey)\
**Post date:** [December 5, 2018, 1:17am UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/5 "2018-12-05T01:17:06Z")

</div>

Ok will give that a shot… What exactly does floor do?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [December 5, 2018, 1:40am UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/6 "2018-12-05T01:40:20Z")

</div>

Here is a reference  
[http://www.cplusplus.com/reference/cmath/floor/](http://www.cplusplus.com/reference/cmath/floor/)

![rfct](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/b949315cdec915ca734658998607d29e38ab1568.png)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [December 5, 2018, 2:49am UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/7 "2018-12-05T02:49:04Z")

</div>

The map node takes one range of numbers and maps it to a different range. If you map 0-1 to 0-10, 0 will map to 0, 1 to 10 and 0.5 to 5, but 0.51 is going to map to 5.1. Passing the map output through floor will round down to a whole number.

---

<div class="post-metadata">

**Author:** ![cmskipsey](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@cmskipsey](https://forum.xod.io/u/cmskipsey)\
**Post date:** [December 6, 2018, 5:03pm UTC](https://forum.xod.io/t/pot-display-number-on-seven-segment-display/1488/8 "2018-12-06T17:03:23Z")

</div>

Aaaah yes, thankyou, I knew I was missing something obvious!
