Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 11 months ago.
7 Segment LED and BusOut
Hello,
I am very new to mbeds and programming. My goal is to get it to display a number, wait, display a number, wait, and display a character (ex 7 wait 8 wait H). Here is my code that I have right now just to try and test it. I am stuck on how to make an H.
#include "mbed.h" BusOut Seg1(p5,p6,p7,p8,p9,p10,p11,p12); int main() { while(1) { Seg1=7; wait(0.2); Seg1=8; wait(0.2); Seg1= } }
After I get it to do this I would like to try and add in some type of calculation, ex 5+5=10, then have it display that answer using the display 1, wait, display 0. Any guidance is appreciated.
1 Answer
11 years, 11 months ago.
you need to send a bit feild to the LED display, not a number ..
Assuming p5 .. 12 represents a.b.c.d.e.f.g dp,
then H would be 0x76,
note it is pure coincidecce that the numer 7 diaplays 7 on LED
b7, b6, b5, b4, b3, b2, b1 ,b0
dp, G F E D C B A
SO FOR 'E'
0111 1001 = 0x79
for 'H'
0111 0110 = 0x76
hpor this helps
Ceri