This is a driver library for the popular QDSP-6064 bubble display. These miniature displays can be leveraged for small breadboard projects in order to display debug information or even in larger projects where LCD displays are unpractical.
Fork of BubbleDisplay by
Diff: bubble.cpp
- Revision:
- 3:1d85399fdea3
- Parent:
- 2:3604f34e944b
diff -r 3604f34e944b -r 1d85399fdea3 bubble.cpp --- a/bubble.cpp Thu Mar 26 08:10:08 2015 +0000 +++ b/bubble.cpp Tue Mar 29 07:51:47 2016 +0000 @@ -44,7 +44,9 @@ * maps the pins in a simple way for the LPC11U24. */ BubbleDisplay::BubbleDisplay(){ +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) init(p21,p22,p23,p24,p25,p26,p36,p35,p34,p33,p30,p29); +#endif } /* @@ -158,4 +160,16 @@ _chrs[1] = c[1]; _chrs[2] = c[2]; _chrs[3] = c[3]; -} \ No newline at end of file +} + +/* + * This writes a sequence of integer number + * to the seven-segment displays. + */ +void BubbleDisplay::write(uint16_t num){ + num %= 10000; + _chrs[0] = (num/1000); + _chrs[1] = ((num/100)%10); + _chrs[2] = (((num/10)%100)%10); + _chrs[3] = (((num%1000)%100)%10); +}