{"id":1443,"date":"2014-09-21T18:08:23","date_gmt":"2014-09-21T16:08:23","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=1443"},"modified":"2014-09-28T16:13:56","modified_gmt":"2014-09-28T14:13:56","slug":"4-digits-7-led-display","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=1443","title":{"rendered":"Arduino : 4 digits 7-led display"},"content":{"rendered":"<p>I got myself a cheap 4 digits 7-led display and I thought I would spend a few mns playing with it and documenting it.<\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1444 size-medium\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits-300x143.png\" alt=\"4digits\" width=\"300\" height=\"143\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits-300x143.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits.png 506w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>12 pins : 8 for the segments (including the dots), 4 for each digit<br \/>\nTop row : 1, a, f, 2, 3, b<br \/>\nBottomw row: e, d, dp, c, g, 4<\/p>\n<p>I decided to use the <a href=\"https:\/\/docs.google.com\/file\/d\/0Bwrp4uluZCpNdE9oWTY0M3BncTA\/edit\" target=\"_blank\">Sevseg <\/a>arduino library.<br \/>\nMore about this library <a href=\"http:\/\/playground.arduino.cc\/Main\/SevenSegmentLibrary\" target=\"_blank\">here<\/a>.<\/p>\n<p><strong>The wiring is then as is :<\/strong><\/p>\n<p>Arduino pins -&gt; 4digits display pins<br \/>\n2-&gt;1<br \/>\n6-&gt;a<br \/>\n11-&gt;f<br \/>\n3-&gt;2<br \/>\n4-&gt;3<br \/>\n7-&gt;b<br \/>\n10-&gt;e<br \/>\n9-&gt;d<br \/>\n13-&gt;dp<br \/>\n8-&gt;c<br \/>\n12-&gt;g<br \/>\n5-&gt;4<\/p>\n<p><strong>Below the schema<\/strong><\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits_bb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1445 size-medium\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits_bb-300x186.png\" alt=\"4digits_bb\" width=\"300\" height=\"186\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits_bb-300x186.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/4digits_bb-1024x638.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Note that this is a lot of digital IO&rsquo;s used. A future article could focus on reducing the number of IO&rsquo;s needed.<br \/>\n<strong>Below the arduino sketch<\/strong> (from the example provided with the sevseg library)<\/p>\n<pre>\r\n\/*Written by Dean Reading, 2012.  deanreading@hotmail.com\r\n \r\n This example is a centi-second counter to demonstrate the\r\n use of my SevSeg library.\r\n *\/\r\n\r\n#include \"SevSeg.h\"\r\n\r\n\/\/Create an instance of the object.\r\nSevSeg sevseg;\r\n\r\n\/\/Create global variables\r\nunsigned long timer;\r\nint CentSec=0;\r\n\r\nvoid setup() {\r\n  \/\/I am using a common anode display, with the digit pins connected\r\n  \/\/from 2-5 and the segment pins connected from 6-13\r\n  sevseg.Begin(1,2,3,4,5,6,7,8,9,10,11,12,13);\r\n  \/\/Set the desired brightness (0 to 100);\r\n  sevseg.Brightness(50);\r\n\r\n  timer=millis();\r\n}\r\n\r\nvoid loop() {\r\n  \/\/Produce an output on the display\r\n  sevseg.PrintOutput();\r\n\r\n  \/\/Check if 10ms has elapsed\r\n  unsigned long mils=millis();\r\n  if (mils-timer>=10) {\r\n    timer=mils;\r\n    CentSec++;\r\n    if (CentSec==10000) { \/\/ Reset to 0 after counting for 100 seconds.\r\n      CentSec=0;\r\n    }\r\n    \/\/Update the number to be displayed, with a decimal\r\n    \/\/place in the correct position.\r\n    sevseg.NewNum(CentSec,(byte) 2);\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I got myself a cheap 4 digits 7-led display and I thought I would spend a few mns playing with it and documenting it. &nbsp; 12 pins : 8 for the segments (including the dots), 4 for each digit Top row : 1, a, f, 2, 3, b Bottomw row: e, d, dp, c, g, <a href='https:\/\/labalec.fr\/erwan\/?p=1443' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-1443","post","type-post","status-publish","format-standard","hentry","category-arduino","category-18-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1443"}],"version-history":[{"count":7,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions"}],"predecessor-version":[{"id":1479,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions\/1479"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}