# Pot display number on seven segment display

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/ 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

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

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

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

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

Here is a reference
http://www.cplusplus.com/reference/cmath/floor/

1 Like

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.

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