FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    ARDUINO-based LED matrix clock production tutorial

     

    Step 1: assembling and connection matrix You do not need to spend a lot of effort, it can be called excellent Arduino multiple LED matrix. However, in this case, the fifth matrix and other matrix series. Of course, you will need a matrix and another group of jumpers. Step 2: Real-time clock Notes My real-time clock (RTC) has opened turned out to be dumb, the new has not come from Hong Kong. Therefore, the time is manually set. Time is to keep the internal clock. Step 3: Digital Display This is my first important project. In the learning process, I started from the LED matrix library LED matrix library of Makepece Madrid used in its 4-LED scrolling text example. DisplayChar function with two integer parameters: matrix addressing number (zero) and the characters to be displayed. Just 0-9 passed to this function to display these numbers. Since a LED matrix does not display two characters, so the digital hour and minute of each spacer must be a variable. They may be separated from the hour and minute in the following manner: The first number: integer divided by 10. This remainder will be discarded (for example, 43 divided by 4.3, the result is divided by 3), the flow returns 4 (first number). Second number: dividing the mold 10, returns the remainder (e.g., 3 to 43 division is obtained). I think the first number in the blank looks better than the leading zero, so the character can not be used as displayChar displayed. Note that the number displayed on the left-aligned each LED matrix. I have not studied Correction Step 4: second Since I have five matrix, I decided to fifth matrix is ​​fixed to hours and minutes, using setLed function by sequentially lighting a single LED labeled on each second row, whose parameters are: LED number (counting from the beginning again 0 ), row, column, and a Boolean value (true = on). I use a nested loop, the first eight rows of the even-numbered LED were tested for skipped. I'm sure there are more elegant ways to write this code, but I just started using C language, and for many years without programming. Step 5: LED clock sketch / * The sketch based MAX72xx chipset clock run with five LED matrix. In https://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino There is shown an example that shows the process of writing and scrolling text on 4 LED matrix. This sketches LedControlMS on page .h (from Makerspace), is a modification of LEDControl.h library. This sketch using the Arduino time and connection library, DS3131RTC (DS3232RCTC Library) Sketch Assume the following connection matrix is ​​MAX72xx LED - Pin 12 is connected to the pin 11 is connected to CLK DataIn Pin 10 is connected to the LOAD DATAOUT (intermediate output pin) daisy-chained to the DataIn matrix except the last one, the next number for each LED matrix. DS3231RTC wiring Are connected to VCC and ground Gnd and + 5VDC "clock" Clock the SDA - "Analog 4 SCL- "Analog 5 * / #include // DS3232RTC clock library can also handle DS3231RTC #include // for clock #include // for clock #include "LedControlMS.h" // note tha t this is not a library LEDControl int h1, h2, m1, m2; // Each LED matrix displays a number: 2 and 1 hour, 1 minute and 2. These variables retain only one digit int s1 = 2; // count the number of seconds an LED int hr12; // for a 12 hour period int noMatrix = 5; // address of the library matrix number up to 8. boolean am = true; // marking the morning or afternoon. Initialized am LedControl lc = LedControl (12,11,10, noMatrix); // Pin number distribution and the matrix (5) void setup () { // First, the system time to the date and time hard-coded, then the system time from the RTC. // setTime () function is a part time library. // Hr Min Sec dd mm yyyy //RTC.set(now());//// system time provided from the RTC // Initialize MAX72XXs (start - in power saving mode when wake-up call. for (int i = 0; i lc.shutdown (i, false); lc.setIntensity (i, 1); // set brightness to a low value lc.clearDisplay (i); // Clear Display } delay (100); // wait for updating between the display lc.clearAll (); } Futile cycle () { // set am or pm Boolean values ​​(am initialized to true) if (hour () "12) {Am = false; hr12 = hour () - 12; } / * Isolation hours and minutes, each one LED matrix. I think the numbers look better for an hour, the first one is empty. * / // If the number of hours that were placed its own variables in h1 and h2 if (hr12 "10) { / * If "10 hrs, then the first LED matrix blank (62 whitespace). Insertion can also be zero, e.g. minutes. * / H1 = 151; h2 = hr12; // second hour digit LED display } Else { // Otherwise, just use two digits of t h1 = h12 / 10; hour on h1 and h2. // integer divided by 10 will return to the first digit of the hour. h2 = hr12% 10; // return the mold 10 is divided by the second digit. } // if (minute () "10) { m1 = 0;, m1 and m2 of the minute show. // first play zero minutes LED d1 m2 = minute (); // second number minute } Else { m1 = minute () / 10; m2 = minute (% 10); } / * Use displayChar function to display the hours and minutes. It uses two integer parameters: LED matrix number (0-7) and the character to be displayed. By transmitting the digital itself as the second parameter, it may simply display numbers: i.e. lc.displayChar (0, h1) * / lc.displayChar (0, h1); // The digit displayed on the leftmost (# 0) LED. lc.displayChar (1, h2); // Number of LED # 1 to 2 hours lc.displayChar (3, m1); // reduced to the 1-bit digital LED # 3. (Recall # 2 is used to mark the number of seconds.) lc.displayChar (4, m2); // reduced to the 1-bit digital # 4 / * This routine determines which of a single LED to light up to count the number of seconds. One by one middle LED lighting a LED on LED counts per seconds. 8 eight LED rows counted in odd rows counted seven LED on even-numbered lines. Thus, two row count 15 seconds. * / for (int r = 7; r "-1; r -) {// for each, from the top line 8 (# 7) starts. . for (int c = 0; c "8; c ++) {// each (left 0) for a row of eight led. . / * Illuminate a point on the current column and row. These seem on my hardware exchanged. So I switched to the following parameters setLed (function). It correctly addressed to setLed (int led #, int row, int col, boolean). Variable s1 is reserved for this LED matrix LED number (counting from 0). * / if (r% 2 == 0 && c == 7) // even rows AND col 7 {} Else lc.setLed (s1, c, r, true); // open addressable LED 3/4 second duration delay (750); lc.setLed (s1, c, r, false); // Close 1/4 seconds delay (250); } } } }, Read the full text

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us