Asked — Edited

7 Led Segment

I am trying to control a seven led segment with ez-b but I not sure how to go about it. Do I have to use 7 different connectors from the ez-b like I would do with an Arduino board?


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

#1  

I is the same type of 3 pin connectors like you use on the arduino. There is ground and hot and signal. But, with the EZB it is WAY MORE Easier.:D

PRO
Synthiam
#2  

It depends on that hardware you are connecting. If it's 7 seperate LED's without a shift register IC, then yes you'd need 7 ports of the EZ-B. Each port would represent a different LED.

In ARC, you can create a function that will display the single digit of a variable by monitoring the variable value. If you need help we can create an example.

#3  

An example will be great DJ, so I can get familiar with the EZ-B

PRO
Synthiam
#4  

Use this example: Example-Script-7SegmentLEDDisplay.EZB

Quote:

Displays the value of $lDisplay on a 7 segment led display.

The Display Value EZ-Script Control loops and displays the value every second from the $lDisplay variable.

You can either use the Random script, or the speech recognition and verbally specify values to be displayed.

Instructions

  1. Connect to Ez-B

  2. Press START on Display Value script

  3. Press START on Random to display random number

  4. Say one of many speech recognition commands (i.e. Set Value three)

Main procedure to display the value of $lDisplay is...


# Init
$lDisplay = 0

:Start

  if ($lDisplay = 0)
    goto(zero)

  if ($lDisplay = 1)
    goto(one)
  
  if ($lDisplay = 2)
    goto(two)
  
  if ($lDisplay = 3)
    goto(three)
  
  if ($lDisplay = 4)
    goto(four)
  
  if ($lDisplay = 5)
    goto(five)
  
  if ($lDisplay = 6)
    goto(six)
  
  if ($lDisplay = 7)
    goto(seven)
  
  if ($lDisplay = 8)
    goto(eight)
  
  if ($lDisplay = 9)
    goto(nine)
  
  if ($lDisplay = 10)
    goto(ten)
  
  if ($lDisplay = 11)
    goto(eleven)
  
  if ($lDisplay = 12)
    goto(twelve)
  
  if ($lDisplay = 13)
    goto(thirteen)
  
  if ($lDisplay = 14)
    goto(fourteen)

  if ($lDisplay = 15)
    goto(fifteen)

  Sleep(1000)

goto(Start)

:zero
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, off)
  set(d4, on)
  set(d5, on)
  set(d6, on)
return()

:one
  set(d0, off)
  set(d1, off)
  set(d2, on)
  set(d3, off)
  set(d4, off)
  set(d5, on)
  set(d6, off)
return()

:two
  set(d0, on)
  set(d1, off)
  set(d2, on)
  set(d3, on)
  set(d4, on)
  set(d5, off)
  set(d6, on)
return()

:three
  set(d0, on)
  set(d1, off)
  set(d2, on)
  set(d3, on)
  set(d4, off)
  set(d5, on)
  set(d6, on)
return()

:four
  set(d0, off)
  set(d1, on)
  set(d2, on)
  set(d3, on)
  set(d4, off)
  set(d5, on)
  set(d6, off)
return()

:five
  set(d0, on)
  set(d1, on)
  set(d2, off)
  set(d3, on)
  set(d4, off)
  set(d5, on)
  set(d6, on)
return()

:six
  set(d0, on)
  set(d1, on)
  set(d2, off)
  set(d3, on)
  set(d4, on)
  set(d5, on)
  set(d6, on)
return()

:seven
  set(d0, on)
  set(d1, off)
  set(d2, on)
  set(d3, off)
  set(d4, off)
  set(d5, on)
  set(d6, off)
return()

:eight
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, on)
  set(d4, on)
  set(d5, on)
  set(d6, on)
return()

:nine
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, on)
  set(d4, off)
  set(d5, on)
  set(d6, off)
return()

:ten
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, on)
  set(d4, on)
  set(d5, on)
  set(d6, off)
return()

:eleven
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, on)
  set(d4, on)
  set(d5, on)
  set(d6, on)
return()

:twelve
  set(d0, on)
  set(d1, on)
  set(d2, off)
  set(d3, off)
  set(d4, on)
  set(d5, off)
  set(d6, on)
return()

:thirteen
  set(d0, on)
  set(d1, on)
  set(d2, on)
  set(d3, off)
  set(d4, on)
  set(d5, on)
  set(d6, on)
return()

:fourteen
  set(d0, on)
  set(d1, on)
  set(d2, off)
  set(d3, on)
  set(d4, on)
  set(d5, off)
  set(d6, on)
return()

:fifteen
  set(d0, on)
  set(d1, on)
  set(d2, off)
  set(d3, on)
  set(d4, on)
  set(d5, off)
  set(d6, off)
return()

Canada
#5  

Great example @DJ... as I verbally counted past 9 it took me a few seconds to recognize that you are using Hexadecimal:P I am now going to dig up a 7 segment LED, I am sure I have kicking around and never used, and try it for real:)