Seven Seg disp. program for arduino HOW TO - Page 1
Forum section: electronics / general

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 10, 2017, 02:49:21 am
content: Another member was kind enough to change this code for a common cathode 7 seg display.I'm trying to add the numbers 9 and 0, but I dont understand how the digits seem to be building on the code of the previous number.This seems to not set up all the segments:QuoteSo how does it over come it by using this: for(j=5;j<=11;j++)Code:/*RaspberryPi's Arduino Sketch modified for Common Cathode 7-segmentdisplayfor Common Anode, write LOW to turn a segment ON, HIGH for OFFfor Common Cathode write HIGH to turn a segment ON, LOW for OFF*//* Al's pin mappings:int a=7;int b=6;int c=12;int d=11;int e=10;int f=8;int g=9;int dp=A0;*/// raspberrypi's pin mappings:int a=7;int b=6;int c=5;int d=11;int e=10;int f=8;int g=9;int dp=4;// for Common Anode, write LOW to turn a segment ON, HIGH for OFF// for Common Cathode write HIGH to turn a segment ON, LOW for OFF//display number 1void digital_1(void){unsigned char j;// digitalWrite(c,LOW);// pin5 low, light up cdigitalWrite(c,HIGH);// pin5 high, light up c// digitalWrite(b,LOW);//light up bdigitalWrite(b,HIGH);//light up bfor(j=7;j<=11;j++)//go out else// digitalWrite(j,HIGH);digitalWrite(j,LOW);// digitalWrite(dp,HIGH);//go out decimal point dpdigitalWrite(dp,LOW);//go out decimal point dp}//display number2void digital_2(void){unsigned char j;digitalWrite(b,HIGH);digitalWrite(a,HIGH);for(j=9;j<=12;j++)digitalWrite(j,HIGH);digitalWrite(dp,LOW);digitalWrite(c,LOW);digitalWrite(f,LOW);}// display number3void digital_3(void){unsigned char j;digitalWrite(g,HIGH);digitalWrite(d,HIGH);for(j=5;j<=7;j++)digitalWrite(j,HIGH);digitalWrite(dp,LOW);digitalWrite(f,LOW);digitalWrite(e,LOW);digitalWrite(c,HIGH);}// display number4void digital_4(void){digitalWrite(c,HIGH);digitalWrite(b,HIGH);digitalWrite(f,HIGH);digitalWrite(g,HIGH);digitalWrite(dp,LOW);digitalWrite(a,LOW);digitalWrite(e,LOW);digitalWrite(d,LOW);}// display number5void digital_5(void){unsigned char j;for(j=7;j<=9;j++)digitalWrite(j,HIGH);digitalWrite(c,HIGH);digitalWrite(d,HIGH);digitalWrite(dp,LOW);digitalWrite(b,LOW);digitalWrite(e,LOW);}// display number6void digital_6(void){unsigned char j;for(j=7;j<=11;j++)digitalWrite(j,HIGH);digitalWrite(c,HIGH);digitalWrite(dp,LOW);digitalWrite(b,LOW);}// display number7void digital_7(void){unsigned char j;for(j=5;j<=7;j++)digitalWrite(j,HIGH);digitalWrite(dp,LOW);for(j=8;j<=11;j++)digitalWrite(j,LOW);}// display number8void digital_8(void){unsigned char j;for(j=5;j<=11;j++)digitalWrite(j,HIGH);digitalWrite(dp,LOW);}// display number9void digital_9(void){unsigned char j;for(j=5;j<=11;j++)digitalWrite(j,HIGH);digitalWrite(dp,LOW);}void setup(){int i;//define ifor(i=4;i<=12;i++)pinMode(i,OUTPUT);//set pin4~pin12 output}void loop(){while(1){digital_1();//number 1delay(500);//delay .2sdigital_2();delay(500);digital_3();delay(500);digital_4();delay(500);digital_5();delay(500);digital_6();delay(500);digital_7();delay(500);digital_8();delay(500);}}

author: Nusa
author_rank: Super Contributor
timestamp: March 10, 2017, 03:23:38 am
content: It's a horrible mixture of direct references to pin numbers combined with named references to pin numbers, combined with hardware assumptions! I'd never write it like that, but I can explain it.Quoteis the same as:Quotewhich is the same as (using pin assignments instead of raw numbers):Quotewhich is the same as (alphabetic ordering):QuoteDoes that make sense?

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2017, 03:49:26 am
content: .... comes from O.P's old topic:https://www.eevblog.com/forum/microcontrollers/arduino-code-compiles-but-doesn%27t-do-anything/msg1156118/#msg1156118, which already has several improved versions of the code.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 10, 2017, 04:10:03 am
content: Quote from: Nusa on March 10, 2017, 03:23:38 amis the same as:Quotewhich is the same as (using pin assignments instead of raw numbers):Quotewhich is the same as (alphabetic ordering):QuoteDoes that make sense?No.This was how I made nine:QuoteBut if I was making it from my own knowledge I would have listed out each segment then told it high/low for each segment.I cheated, it worked but I don't really understand why it worked.

author: rstofer
author_rank: Super Contributor
timestamp: March 10, 2017, 05:21:33 am
content: Quote from: raspberrypi on March 10, 2017, 02:49:21 amThe for loop sets pins 5..11 HIGH and dp (defined elsewhere) low. This is truly ugly in the sense that it only works for the segment lines connected to pins 5..11. Make a change in the mapping and the whole thing is junk.A '9' has segments 1,2,3,6,7 on, 4,5 are off, dp is off (I guess)for (j-5;j<8,j++)DigitalWrite(j,HIGH);for (j=8; j<10;j++)DigitalWrite(j,LOW);for(j=6;j<8;j++)DigitalWrite(j,HIGH);DigitalWrite(db,LOW);a '0' has segments 1,2,3,4,5,6 ON, 7 OFFCounting the DP, there are 8 things to control. The conventional way to do this is to predefine the output as an array of bytes with the LED pattern and then just use the digit value as an index to pick up the pattern, You would write the entire byte to the port. This makes assumptions about how the pins are laid out.You could still pick up a byte containing the 8 bits and just send the bits out 1 by 1. This would still be a lot less code than what is shown above.

author: Nusa
author_rank: Super Contributor
timestamp: March 10, 2017, 07:03:17 am
content: Is it that you don't understand how for loops work? The syntax is:for (initialization; conditional test; increment)statement; // use brackets {} if multiple statementsunsigned char j;for(j=5; j<=11; j++)digitalWrite(j,HIGH);Equivalent code, with added comments:unsigned char j;// initializationj = 5;// conditional testwhile ( j <= 11) // if j is less than or equal to 11, do the loop statements{ // start of loopdigitalWrite(j,HIGH); // j is different each time through the loop// incrementj++; // ++ operation means j = j+1} // end of loop, go back up and do conditional test// if we get here, j must be greater than 11

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 10, 2017, 07:20:44 am
content: Here's another _simple_ example of "crap" code. Try it, using your own pin-to-segment mappings.Code:/* HELLO PI 7 segment Common Cathode display example***A***F B***G***E C***D*** dot*/// assign pin numbers to segments, change as needed, seg=pinint a=7, b=6, c=12, d=11, e=10, f=8, g=9;// setup pins as outputsvoid setup() {pinMode(a, OUTPUT); //segment apinMode(b, OUTPUT); //segment bpinMode(c, OUTPUT); //segment cpinMode(d, OUTPUT); //segment dpinMode(e, OUTPUT); //segment epinMode(f, OUTPUT); //segment fpinMode(g, OUTPUT); //segment gpinMode(A0, OUTPUT); //segment dot, change as needed for your mappingdigitalWrite(A0, 0); // start with the "dot" off}// make function to turn all segments OFFvoid AllOff() {digitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(100);}// main loop to write letters to displayvoid loop() {// write "H" = bcefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 1);delay(500);AllOff();// write "E" = adefg segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 1);delay(500);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 0);delay(500);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 0);delay(500);AllOff();// write "O" = abcdef segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 1);digitalWrite(c, 1);digitalWrite(d, 1);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 0);delay(500);AllOff();delay(500);//write "P" = abefg segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 1);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 1);digitalWrite(g, 1);delay(500);AllOff();//write "I" = bc segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(500);AllOff();delay(1000);}Does that make sense to you?

author: rrinker
author_rank: Super Contributor
timestamp: March 10, 2017, 01:55:56 pm
content: Let's start with this, what part of Nusa's list of various code segments that all mean the same thing don't make sense?At the end of your reply to that post, you said if you would have done it yourself you would have individually listed each segment to turn on or off - which IS the right way to do it. Using FOR loops like that is messy and doesn't neatly fit all combinations of digits and is NOT the right way to do it.The way you made your 9 and lucked in to it working is because you combined both methods. You have a FOR statement which runs the variable j from 7 to 9, but then you have one digitalWrite for each segment, setting it's proper state to display a 9. The FOR line is entirely superfluous. It does nothing there.The outputs set for each digit are in no way dependent on any other digit. For each individual digit, you turn on and turn off the segments as needed to form the digit. But each chunk of code for a given digit is entirely independent of the chunk of code for any other digit. How you make a 4 has no effect on how you make a 7 or a 2.

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2017, 04:53:36 pm
content: I don't know who came up with the idea of writing one function per individual digit displayed, but IMHO it teaches bad habits and is actively damaging to the skills and intelligence of a novice programmer. Maybe that's why the Arduino IDE doesn't come with a 7 segment example preinstalled?I've looked around the web a bit and found that the tutorials for single 7 segment displays either have cringingly bad code or cringingly bad circuits. I cant emphasize enough:You *MUST* have a resistor between each Arduino output and the LED segment pin it is driving to limit the segment current.Assuming your display has the same max. current rating for the decimal point as it does for the segments you will need 8 resistors of the same value. Now you could subtract the LED's Vf from 5V then use Ohm's law to work out the resistor value, but when it comes down to it, you are unlikely to have the exact calculated value handy, so are likely to end up using a bunch of 220R (brightest), 330R or 470R (dimmest) resistors.Any tutorial that says "One resistor in series with the digit common pin" is pure garbage - at least as far as the circuit goes. Why? Well lets consider displaying '8':All the Arduino segment output pins are at the same level, and their output MOSFET on resitance is very low, so the segment LEDs are effectively directly in parallel. Leaving aside the inherent badness of directly paralleling LEDs, lets consider that '8' - 7 segments lit sharing the current through one resistor. Now lets consider '1' - two segments lit with nearly the same total current. Its fairly obvious that the segments in the '8' will only get 2/7 of the current the segments in the '1' got so the '8' will be far dimmer than the '1'.The best tutorial for the schematic and wiring plan I have found is:http://www.arduino.org/learning/tutorials/boards-tutorials/7-segment-display-exampleIts code isn't great but at least isn't fugly and does get away from the one function per digit brainrot!@Raspberrypi,Your idea of looping through the segments using for() is in principle sound, but is fundamentally misapplied. You are missing the concept of indirection - using one number to look up another from an ordered list, by its position in the list - specifically from aC array. By storing the list of pins corresponding to segments a-g and d.p. in an array, you gain the ability to step through the pins in segment order without having to wire them in a special order to match the Arduino pin numbers. Similarly, you can have an array of the ON or OFF states of the segments for a particular digit, that the same loop that steps through the pins uses to look up the state to set each pin to.Alternatively, but simpler you could just store the lit segments for a particular digit as a list of pin numbers, but then you need a terminator for the list as they wont all be the same length.There is one fly in the ointment - when you initialise an array, you can specify a list of numbers orenumed or#defineed constants. You absolutely CANNOT specify a list of variables or Cconsts. That means you have to throw out all that:Code:int a=7;int b=6;int c=5;int d=11;int e=10;int f=8;int g=9;int dp=4;Instead you can define the segment names as an anonymousenum:Code:enum {a=7,b=6,c=5,d=11,e=10,f=8,g=9,dp=4,end=99 // No 100 pin Arduinos exist!};You can now define an array of pins to set and loop through them:Code:void blank(void){const char OffList[]={a,b,c,d,e,f,g, dp, end};// Turn all segments offfor(char i=0; OffList!=end; i++){digitalWrite(OffList,OFF);}}and to display a '4':Code:void disp4(void){const char OnList[]={b,c,f,g, end}; //segs for '4'blank(); // Turn all segments off// Turn selected segments onfor(char i=0; OnList!=end; i++){digitalWrite(OnList,ON);}}It also need OFF and ON declared to suit your display.Put this at the top for common cathode:Code:enum {OFF=0, ON=1}; // Common cathodeYou could extend it by writing separate functions disp0() through disp9(), each with its own list of segments to light but that breaks the'Rule of Three'so you'd do better learning how to create two dimensional arrays and passing a row reference for the number to show into a single disp(n) function.There's more than one way of skinning this cat and some are more efficient than others. e.g. The example I posted to your previous topic packs the segment state data as bits in a byte, which saves a lot of memory, but that requires more advanced knowledge of C bitwise operators and boolean algebra.

author: rstofer
author_rank: Super Contributor
timestamp: March 10, 2017, 06:38:41 pm
content: Now the code is getting a lot better!I went looking in the Examples folder and discovered, as many have before me, there is no 7 segment example. Then I went looking on the Internet and discovered some really regrettable examples.One solution, if Rx and Tx aren't needed, is to use pins 0-7 (PD0-PD7) as a byte wide port for the segments. Then it's just a matter of fetching the segment byte value from an array and writing it to the entire port. Alas, I suspect Rx and Tx may not be vacant. FWIW, I haven't tried this and there is the possibility of conflict with uploading sketches. It should work but I haven't proven it.If the app uses Rx and Tx then this approach won't work!

author: Benta
author_rank: Super Contributor
timestamp: March 10, 2017, 07:18:09 pm
content: Reading through this thread, I'm aghast. But that's perhaps I'm an old guy who never did fancy object-oriented programming and whatever it's called.Alone the idea of having a function for each possible number (0...9) and then banging each bit/segment is to me the reason for the "bloatware" that you see all over the place.My approach would be:A static array of bytes (unsigned chars) indexed 0...9 (or 0...15 if you want hex as well)I - a b c d e f g dp------------------------0 - 1 1 1 1 1 1 0 X1 - 0 1 1 0 0 0 0 X2 - 1 1 0 1 1 0 1 X...9 - 1 1 1 1 0 1 1 XTake the binary/BCD input value (which should be 0...9 or 0...15) and use it as index into the array. The returned value is the segment pattern. Send it to the port, add dp as necessary.I'd do this in assembler in 10 min., and it would be maximum 40 instructions, depending on architecture.I could do it in C as well, if you like. It will also be quite small.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 10, 2017, 07:45:44 pm
content: The thing that most of you Real Programmers are missing is that the OP is barely beyond the "blink one LED" stage of writing programs for his Arduino. And the first program for his 7-segment display using the "for" loops wasn't written by him at all but was copy-pasted whole from the site that sent him the wrong display type in the first place. (The original program was written for common Anode display but they sent him a common Cathode display.)Turning on each needed segment individually using digitalWrite statements and directly and explicitly stating which pin to map to which segment is the most straightforward and easiest way to get something working. Each "more advanced" method I've seen posted here likely has something wrong with it and needs debugging before it will work. It is almost like you don't actually _try_ your program suggestions on the real hardware before you post your suggestions.This is not to say that more advanced programming is "bad" or unwelcome. It is just that you are likely to make your virtual student's eyes glaze over and give up in frustration. Once a _simple_ method of lighting up a bunch of LEDs in a desired pattern is accomplished and _understood_, then it is the time to gradually improve the code a little piece at a time to make it more compact and to use more advanced programming concepts. I'm quite sure there are even more advanced ways of sending some digits to a 7-segment display that are even murkier and more difficult for a _raw beginner_ to understand. Is it helpful to toss these at a raw beginner who doesn't even grasp the basics yet? I don't believe it is. Sure, there are many ways to do almost any task in computing. The "proper" ways are ways that actually work and are actually clearly understandable by the user/programmer. Indexing through a character array might work for your own level and style, but if you don't know how to use arrays yet and you just want to see some numbers on a display, maybe it's not appropriate. Hexadecimal? BCD? At this level of skill and knowledge?There are more considerations here than just "who can write the most compact advanced program". I'm just waiting for someone to post an all-assembly language routine that does the whole thing in 4 lines of code.This very thing ("showing off" by pitching answers way above the level of the questioner) is one reason why the Arduino forum itself is so frustrating and not useful for many beginners.

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2017, 09:59:47 pm
content: Yes, there's a certain amount of that going around, but the tedium of retyping or even copy/pasting screenfull after screenfull ofCode:digitalWrite(11,0); //Seg d offthen editing one or two numbers on each line, then the resulting misery of bug-hunting for the mistyped pin or state, without an interactive debugger, should rapidly drive any aspiring Arduino programmer to learn more C so they can start working smarter not harder.7 segment LEDs are not really a beginner level Arduino project. Yes, a beginner can bit-bash a single digit as if it was just seven individual LEDs but to do useful stuff like display two digits, you either have to give up 14 pins, most of those available, or learn multiplexing, or use a port expander of some sort, and you have close to zero chance of succeeding by cargo cult programming with a build - burn - crash development cycle, especially if you haven't got the first clue on how to debug a MCU.IMHO it should be start by set a static digit, then alternate two digits, by straight pin flipping in loop(), then the Arduino site's7 segment example using switch() ... casecan be introduced.After that, as the programmer's C skills grow, stuff like indirection with arrays can be introduced. I suggested a 1D array approach above as a first step using indirection - still painful but far less so than the screenfulls of digitalWrite(). I'm also attaching a version that uses a relatively poor algorithm - turn all segments off then turn a selective list for the current digit on, but that is easy to implement cleanly using 2D arrays (or in this case an array of arrays). Tested + working. Not posted in code tags not to distract the O.P.

author: Benta
author_rank: Super Contributor
timestamp: March 10, 2017, 11:02:17 pm
content: QuoteSorry, no. That's just intellectual laziness.Plotting the binary bits to the relevant segments on a piece of paper, a blackboard, flipchart, whatever is the first thing to do.If writing out those ten lines of 0s and 1s is too strenuous - then logical and structured thinking is not for you.A suggestion: study a datasheet of a BCD-to-7segment IC (like 74LS247). Would anyone ever think of turning on each segment separately?

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 11, 2017, 02:29:56 am
content: Quote from: Benta on March 10, 2017, 11:02:17 pmSorry... no. It is pitching an _answer_ to a problem at a level that the questioner is likely to be able to understand immediately, and get his project working immediately.QuoteNo, the OP had a program that he copy-pasted and was trying to get it working with the wrong hardware. What good does plotting binary bits do to solve that immediate problem for someone at the OP's level of experience? Nothing at all but creating more confusion.QuoteAnd if pitching your answer so that the questioner has a chance of understanding it is too strenuous for you, then you aren't going to be much of a teacher, even if you know your subject backwards and forwards and upside down. Thank you for your criticism though.QuoteAnd is that going to solve the OP's original problem, which involves only an Arduino, some resistors and a single 7-segment display? Of course not.OK, I give up.

author: Ian.M
author_rank: Super Contributor
timestamp: March 11, 2017, 05:26:19 am
content: Just for s--ts and giggles, I've extended the sketch from reply#12 to support multiplexing.It displays up to 4 digits (with leading zeros) without using interrupts - simply rip out the delays in loop() and call mux7seg() with the number and the length of time (in ms) to display it for. d.p. handling isn't implemented yet - they are currently dark.Its currently configured fortwo common anode digits, with the anodes on pins 3 and 2, but could easily be reconfigured for up to 4 digits (it would do 5 but the top digit would be limited by the integer range), and for a common cathode display, with or without inverting digit drivers. Segment pins remain the same as the O.P's common cathode single digit display. Reconfiguration is as usual trivial - just edit the definitions at the top of the sketch.Tested on Arduino Uno with a FD-HR4516T display, using NPN emitter follower anode drivers, to buffer the mux digit lines, and 330R resistors in the segment lines.Edit: div() uses signed maths so its only currently good to 4 1/2 digits.

author: Ian.M
author_rank: Super Contributor
timestamp: March 11, 2017, 05:40:41 am
content: Quote from: Benta on March 10, 2017, 07:18:09 pmI already did it like that in C in the O.P.s old thread.Reply#23or Reply#30 for the corrected and tested sketch:seg7a.ino.txtIts still using the Arduino I/O pin HAL, so its nowhere near as efficient as your proposed assembler version, but I did unroll the segment pin-bashing loop so it doesn't have to write to a variable pin number, and can optimise the bit masks to constants.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 12, 2017, 11:47:42 am
content: I like to hear that there are many different ways to do this and ways to learn it. I honestly thought the only way to do this was to do digitalwrite for every pin everytime.But most here were so preoccupied with coming up with the most/efficient/complex/hard to understand way, the first problem and basic trouble shooting was over looked: wrong hard ware sent with the kit. Making more efficient code sounds nice but how does that help when the bread board has to be rewired? When some of the people see a super easy question they come up with the most complicated way to fix it that they know wouldn't make sense to someone who just learned what "C" was a few days ago. Kind of turns people off the entire hobby let alone posting questions on a forum. Also theres some things I can't do, like see a data sheet due to the way I have to zoom in to see the screen because of my eye sight.

author: Ian.M
author_rank: Super Contributor
timestamp: March 12, 2017, 02:34:19 pm
content: Quote from: raspberrypi on March 12, 2017, 11:47:42 amUnfortunately, not only did the breadboard have to be rewired, but you had to go through that code line by line because it wasn't flexible enough to permit easy reconfiguration. I know that sufficiently flexible code is well above your current level, but the more cleanly designed and better written the code is, the easier it is to work on, unlike the reeking P.o.S. code from your supplier, so please bookmark the topic so you can easily come back to it after your C programming knowlage has grown a bit.Quote from: raspberrypi on March 12, 2017, 11:47:42 amHmm, PDFs can be very difficult to use with screenreaders because of the way the file format breaks up natural flows of text. If you are really stuck, post a link to the datasheet and ask. Under the circumstances, there are many here who will be glad to help.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 13, 2017, 11:50:24 pm
content: Quote from: Ian.M on March 12, 2017, 02:34:19 pmI appreciate that. Data sheets are hard to read when there is lots of scrolling involved and matching up columns and rows, and sub scripts are almost impossible. I often mistake milli for micro and decimals for commas when doing math.. In one thread I kept asking the same question and kept getting the same reply: READ THE DATA SHEET. I'm legally blind not retarded. One classic post some one sent was just this:QuoteReally, you think? Ohms law when using electronics? How ever did you come across such infinite wisdom!? I thought when engineers put certain value parts in their designs it was just a combination of guess work with every color coded part based on a matching color scheme they thought was pretty.

author: Ian.M
author_rank: Super Contributor
timestamp: March 14, 2017, 01:16:28 am
content: Yes. Not everyone is smart enough to read your .sig and appreciate that you may have problems with anything you can't view as inch high characters, (or whatever method you use). I would suggest that you explicitly mention that you are having difficulty finding a particular parameter in a datasheet, or you need your math and source data checked for a formula. Anyone participating in a topic who is too crass to take a few moments to accommodate a fellow tech's disability doesn't deserve to be welcome here.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 14, 2017, 02:47:45 am
content: Quote from: Ian.M on March 14, 2017, 01:16:28 amI think if most people started having vision problems they would just stay away from electronics because its too hard. Well it is too hard, but I refuse to give into it even if it takes me five minutes to read a resistor or imprint code on a transistor. Those are the people just give up on life and "try" to live off social security, only to find our social programs have been to gutted and you can't live off government assistance without the help of family. The showing off with purposely over technical answers gets irritating fast when your only limit isn't your brain or effort, but lack of eye sight.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 14, 2017, 11:16:51 pm
content: This program makes the outer edges of the display "chase" each other around starting with the top seg and going in a clock wise fashion.Anyone know why seg C and E dont light up? I checked the connections and its something in the code because I can get them to light if I switch the wires around. I'm stumped.Code:/* HELLO PI 7 segment Common Cathode display example***A***F B***G***E C***D*** dot*/// assign pin numbers to segments, change as needed, seg=pinint a=7,b=6,c=12,d=11,e=10,f=8,g=9;// setup pins as outputsvoid setup() {pinMode(a, OUTPUT); //segment apinMode(b, OUTPUT); //segment bpinMode(c, OUTPUT); //segment cpinMode(d, OUTPUT); //segment dpinMode(e, OUTPUT); //segment epinMode(f, OUTPUT); //segment fpinMode(g, OUTPUT); //segment gpinMode(A0, OUTPUT); //segment dot, change as needed for your mappingdigitalWrite(A0, 0); // start with the "dot" off}// make function to turn all segments OFFvoid AllOff() {digitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);}// main loop to write letters to displayvoid loop() {// write "H" = bcefg segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "E" = adefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "O" = abcdef segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 1);digitalWrite(g, 0);delay(15);AllOff();// write "H" = bcefg segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "E" = adefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "O" = abcdef segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 1);digitalWrite(g, 0);delay(15);AllOff();//write "I" = bc segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();digitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "H" = bcefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "E" = adefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 1);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();// write "L" = def segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 1);digitalWrite(g, 0);delay(15);AllOff();// write "O" = abcdef segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 1);digitalWrite(f, 0);digitalWrite(g, 1);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 1);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 1);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 0);digitalWrite(c, 1);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);delay(15);AllOff();//write "P" = abefg segments ON, others OFFdigitalWrite(a, 0);digitalWrite(b, 1);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 1);delay(15);AllOff();}

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 02:05:15 am
content: I *ASS*U*ME* you are using an Arduino Uno or clone. If your board does NOT have an ATmega328P my debugging code will not work!I've added some debugging code to your sketch that pauses it and waits for you to click the  button in the Arduino serial monitor to continue. It also prints where in the sketch its paused, and the levels of all the Arduino pins (but not whether they are inputs or outputs). You should be able to step through and find out where its going wrong. Zipped sketch attached - unpack in your sketchbook folder (one level up from ordinary sketch folders).I had to tweak a few things to let me test it on my 7 segment display, but I've set them all back to be compatible with your hardware.I would suspect that what you've done wrong is either mixed up the digitalWrites for the missing segments, or the pin to segment mapping at the top of the program.******************************************To add my printf debugging stuff to your own sketch:Menu Sketch: Show Sketch Folder.Close Arduino IDECopy dbprintf.h, AVR_UART_IO.h and AVR_UART_IO.c to the sketch folder.Reopen the sketch in the Arduino IDE by double clicking the .ino file.At the top of the sketch put:Code://#define NODEBUG //uncomment this to run normally#include "dbprintf.h" // for DBP() debug printf#ifndef NODEBUG#include "AVR_UART_IO.h" // for printf()#endifThat adds the debugging stuff (dbprintf.h) and connects the ANSI C stdio streams to the UART so printf() etc. work normally, like they would in a C program on a PC. Uncomment the #define NODEBUG to disable all the debugging code without editing the rest of the prigram.At the top of setup(), add:DBC(UART_Init(Baud2UBRR(9600))); //DEBUG: Setup serial port @9600 BaudThat sets up the UART, which needs to be done before any of the DB***** commands use it.Then you can use any of the following debugging statements in your program:DBP(...); - Prints stuff to the serial console - See ANSI C printf() function for details.DBHALT; - Shows the location and halts the programDBTAG; - Shows the locationDBPAUSE; - Tells you its paused and waits for a character from the terminal. Click  to continueDBC(...); - When you only need to do something if debugging. It conditionsally compiles the statement or expression its wrapped around.DBPINS; - Shows the state of all UNO pins.After uploading your program, open the Arduino Serial Monitor (icon at far right of toolbar), make sure its set for 'Newline'*and '9600 Baud', and have at it. If you had to change any Serial Monitor setting, press the Arduino reset button.* If its waiting at a DBPAUSE, clicking  sends a single newline character, which lets DBPAUSE continue.N.B. You cant mix this serial printf() debugging with the Arduino serial library.

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 02:10:45 am
content: P.S. Running it with the debugging disabled here chases through all the segments so you may have a hardware fault (i.e. you've done something nasty to those two Arduino pins). It would be worth trying a very simple sketch to turn on the pins for segments C and E to see if they light.:Code:void setup(){pinMode(7, OUTPUT); digitalWrite(7, 1); // Turn on CpinMode(9, OUTPUT); digitalWrite(9, 1); // Turn on E}void loop(){} //Empty loopto prove there's nothing wrong with the hardware.If there is a problem with those pins on the Arduino, assuming its a UNO with a socketed ATmega328P chip there's still a way to fix it as the ArduinoISP sketch for programming blank ATmega chips i(n a breadboard or on a target board with a 6 pin AVR ISP header), doesnt use pins 7 and 9 for anything important - they are only for indicator LEDs. You could buy a new blank ATmega328P, program it with the Arduino bootloader using the damaged Arduino, and a breadboard and finally replace the bad ATmega2328P with the freshly programmed good one. However if you damage pins 10,11,12 or 13, and you don't have a spare Arduino or a preprogrammed ATmega328P with the Arduino bootloader or an AVR ISP programmer, its game over - you cant use that Arduino any more to program a new chip to let you fix its self.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 03:12:52 am
content: .

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 03:41:23 am
content: .

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 04:02:21 am
content: .

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 04:13:52 am
content: Ah, OK, now I think I understand. You deliberately changed the sketch to make the "chaser". But when you change a sketch to do something different, you MUST also _eliminate or change_ the Comments ! Otherwise poor fools like me will get confused when they try to help you out.If all you want to do is to light up segments A, B, C, D, E, F in a "chase" sequence you don't need all those extra statements in what you posted.You only need to do this:Declare variables, make pin assignmentsSetup: Designate pins as OUTPUT, Start with all segments off.Loop:One line to turn on one segment, one line for desired delay On time, one line to turn it off again.Repeat for each of the six outer segments.Continue looping.So the main Loop only needs to be about 18 lines long.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 05:18:28 am
content: .

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 05:35:45 am
content: AARGH !!Ok, I think that the Display Pins are not correctly assigned to Segments:Compare:

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 06:22:37 am
content: What a dog's breakfast this has become. My pin assignment "guesses" in the sketches I posted were based on his original pin assignments, which I now see have changed, so he is now apparently using Arduino pins5, 6, 7, 8, 9, 10, 116, 7, 8, 9, 10, 11, 12 according to the photo. And according to the Data Sheet (and my own 7segCC display) it appears that he has the wrong pins of the display associated with the segments.EDIT: See next 2 posts !! The Arduino pin numberings are wrong too, because of the shield's inaccurate number placements !!So... I think this is how the hardware should be wired:Display Pin 7 > 220R > Arduino Pin 6 (segment A)Display Pin 6 > 220R > Arduino Pin 7 (segment B)Display Pin 4 > 220R > Arduino Pin 8 (segment C)Display Pin 2 > 220R > Arduino Pin 9 (Segment D)Display Pin 1 > 220R > Arduino Pin 10 (segment E)Display Pin 9 > 220R > Arduino Pin 11 (segment F)Display Pin 10 > 220R > Arduino Pin 12 (segment G)Display Pin 5 (dot, not used)Display Pins 3 and 8 to GroundUsing of course the _actual_ Display Pin Numbers as given in the Data Sheet.Then the "chasing" program becomes (NOTE: I changed the Arduino pin numbers to correspond to the _actual_ wiring in the photo of the shield, using 6-12 rather than 5-11.)Code:/* Sketch to "chase" outer segments of 7-segment display */int a=6; // Display segments = Arduino pin #sint b=7;int c=8;int d=9;int e=10;int f=11;int g=12; // not usedint dp=5; // or 13, but not used in present configurationint dwell=200;void setup() {pinMode(a, OUTPUT); // set all pins as OUTPUTspinMode(b, OUTPUT);pinMode(c, OUTPUT);pinMode(d, OUTPUT);pinMode(e, OUTPUT);pinMode(f, OUTPUT);pinMode(g, OUTPUT);pinMode(dp, OUTPUT);digitalWrite(a, 0); // make sure all segments OFF to start withdigitalWrite(b, 0);digitalWrite(c, 0);digitalWrite(d, 0);digitalWrite(e, 0);digitalWrite(f, 0);digitalWrite(g, 0);digitalWrite(dp,0);}void loop() {digitalWrite(a,1); //turn on segment a, wait "dwell" milliseconds, turn off segment adelay(dwell);digitalWrite(a,0);digitalWrite(b,1);delay(dwell);digitalWrite(b,0);digitalWrite(c,1);delay(dwell);digitalWrite(c,0);digitalWrite(d,1);delay(dwell);digitalWrite(d,0);digitalWrite(e,1);delay(dwell);digitalWrite(e,0);digitalWrite(f,1);delay(dwell);digitalWrite(f,0);}Using the Arduino pins in sequence like this makes it easy to "shrink" the code considerably by using "for" loops. I'll leave that as an exercise.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 07:25:21 am
content: There seems to be another numbering problem. On the SHIELD that rp is using, the numbers are strange. On the original Arduino UNO, the "GAP" is between pins 7 and 8. But the shield's numbers are offset somewhat. So it appears that the actual wiring in use is using from Pin 6 thru Pin 12, NOT from 5 thru 11 as in the "Segtable" drawing.This should be changed in the sketch I posted above, or on the shield, whichever is easier.EDIT: I already changed the numbers in the sketch above to correspond to the photo of the shield.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 08:10:26 am
content: Here I've corrected the "Segtable" for the actual Arduino Pins in use and the correct numbering of the Display Pins (TOP VIEW) and their segment names.NOTE: Check the value of the leftmost resistor ! It looks like 100R to me !! This appears to go to Pin 1 of the display, which is the "E" segment, and Pin 10 of the Arduino.I would advise checking the Arduino's Pin 10 to see if it is still operational, as well as checking the Display's segment E.

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 08:23:20 am
content: I'll take your exercise and raise you a chaser for a two digit, normally multiplexed display. Attached. Configurable for any segment ordering etc. It chases clockwise round segments a,b,c,d of the right digit then round d,e,f,a of the left digit then moves to the inner segments: right f,g,e then left c,g,b.@RaspberryPi: It uses indirection via arrays + a little bit of bitwise boolean maths to pack a flag bit for left or right display into each pin number byte of the sequence, so if you aren't ready for that yet please skip this post.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 08:32:08 am
content: Well, OK.... but personally I only have the one 7segment display, and as I've pointed out there are problems with RP's pin numbering assignments.Here's the "exercise", admittedly specific for one display unit and the Arduino pin and display pin numberings as shown in the photo and comments. I'd like to know how this works for RP with his _current_ hardware setup... after making sure that that 100R is changed to 180R to match the rest of the resistors.This can be viewed as an elementary introduction to the use of "for" loops.Code:/****************************************************Sketch to "chase" outer segments of a single 7-segment CC displayusing Arduino Pins 6 thru 12Wire Common Cathode display as follows:Display PIN numbers (top view):10,9,8,7,6********** ** *********** ** ********** *1,2,3,4,5Segment Names:***A***F B***G***E C***D*** dotDisplay PINS to segments (top view):***7***9 6***10**1 4***2*** 5 (3, 8 to GROUND)Display Pin 7 > 220R > Arduino Pin 6 (segment A)Display Pin 6 > 220R > Arduino Pin 7 (segment B)Display Pin 4 > 220R > Arduino Pin 8 (segment C)Display Pin 2 > 220R > Arduino Pin 9 (Segment D)Display Pin 1 > 220R > Arduino Pin 10 (segment E)Display Pin 9 > 220R > Arduino Pin 11 (segment F)Display Pin 10 > 220R > Arduino Pin 12 (segment G)Display Pin 5 (dot, not used but could use AP 13)Display Pins 3 and 8 to Ground*********************************************************/int dwell = 300; // set speedint j=0; // count variable for use in "for" loopsvoid setup() {for(j=6; j<14; j++) // set all used Arduino pins to OUTPUTpinMode(j,OUTPUT);for (j=6; j<14; j++) // turn off all segmentsdigitalWrite(j, 0);}void loop() { // turn on each outer segment in sequencefor(j=6; j<12; j++) {digitalWrite(j,1);delay(dwell);digitalWrite(j,0);}}

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 08:45:20 am
content: Yes. planning the pin allocation to simplify the software is an entirely respectable strategy, even if there is the risk of it biting you in the ass. e.g you are at 98% FLASH used and you get that email from marketing:QuoteI've cut down my two digit chase to a single digit and patched in your straight through pin mappings, though that rather defeats the object of the redirection!

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 15, 2017, 08:48:29 am
content: Specification creep! Another reason why IANAP.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 16, 2017, 05:17:54 am
content: I'm trying to fix this, but when I go to compile it says:QuoteWhat does dbprint.f do? How do I create it? This just goes into the sketch file?Also huge thanks for all this help!!!!!

author: Ian.M
author_rank: Super Contributor
timestamp: March 16, 2017, 05:54:58 am
content: Are you talking about the dbprintf.h I discussed in reply#23?You have tocopythe files I mentioned from the zipped sketch I provided into your own sketch folder to use them. As my debugging macros and AVR_UART_IO stdio driver aren't ready for prime-time yet, I haven't packaged them as an Arduino library so you need to explicitly add them to each sketch.AVR_UART_IO.c and AVR_UART_IO.h are the driver that implements blocking unbuffered stdio streams over the ATmega328P UART, so theC printf()function prints to your serial console (or other terminal). Its more or less code straight from the Arduino datasheet and the AVR GCC libc documentation.Currently the AVR_UART_IO stdio driver is ATmega328P specific so if you are using an Arduino with a different chip you are S.O.L. I did experiment with using the Arduino serial stream library but was having difficulty getting it working properly - it was scrambling its output. If I can sort that out, it would work for all AVR based Arduinos.Although very powerful, printf() is generally too bloated and slow for most applications on 8 bit MCUs, taking up too much RAM and program memory. However if you've got the resources available, its very convenient compared to te alternatives.N.B. the embedded AVR GCC family of printf() functions (as supplied with the Arruino IDE), DO NOT support floating point.dbprintf.h provides various macros wrapped around a normal C printf(), the most notable of which is DBP():Code:#define DBP(format, ...) fprintf_P(stderr, PSTR(format), ##__VA_ARGS__)It uses the AVR fprintf_P() function to printf() a string stored in program memory + whatever extra variables the string has placeholders (format specifiers) for to stderr. Stderr is the error output stream and is where as a C programmer you are meant to send messages that aren't normal output. The PSTR() macro forces its string argument into program memory so that DBP() doesn't eat up all your RAM if you use it a few times.Most of the other macros build on DBP() with some use of the compiler's __FILE__ and __LINE__ macros to tell you where in the program the current message came from (e.g. DBTAG)I discussed their usage in brief back in post #23 or look at the .ino file in tat sketch for inspiration.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 16, 2017, 06:57:46 am
content: Quote from: alsetalokin4017 on March 15, 2017, 07:25:21 amThat was the problem, bad silk screen and bad eye sight.I rewired the whole thing and shifted all the pins down one notch. Now it works.I'm still going to try to learn the debugging code from above. Seems its the simplest things have been the problem this whole time.Lesson I have learned: Start at the first step, check the hardware, then the wiring on the board, then the output of the arduino, and last check the code.

author: Ian.M
author_rank: Super Contributor
timestamp: March 16, 2017, 07:17:01 am
content: If you are having difficulty with my way of doing stuff, you may wish to do it the pure Arduino way, which is to use Serial.print() and Serial.println().e.g. for debugging, to show the variable i with identification of what it is, you'd do:Code:Serial.print("i="); Serial.println(i);to print its value prefixed by "i=". .print just sends a single string or variable to the output, .println is almost the same but starts a new line afterwards. Before use you need to set it up with:Code:Serial.begin(9600);(or whatever other standard baud rate you want to use), which is usually done in setup().Seehttp://sheepdogguides.com/arduino/aht1serimoni.htmfor an entry level introduction.Personally, as a 'dyed in the wool' C programmer I don't like Arduino Serial much, and have had unexpeced and misleading results from it, though maybe I was doing something wrong at the time. Also I am a lazy typist hence my terse debugging printf macros. However it would have been remiss of me not to present the more 'Arduino-land' mainstream way of printing stuff to you.Remember: you cant mix Serial.<anything> with my AVR_UART_IO in the same program, nor is there an easy way to mix it with the standard C printf(). (It can be done by snprintf() to a buffer then passing that buffer to Serial.print but that's a royal P.I.T.A.)

author: Nusa
author_rank: Super Contributor
timestamp: March 16, 2017, 07:49:10 am
content: The silk screen on the shield isn't actually bad, it's just that the labels in question are aligned with the unpopulated solder pads, not the tall arduino headers. You don't seem to be actually using any of the shield features, so you could remove it. The labels on the UNO board underneath probably ARE for those headers.