1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Arduino uno - Matrix scripture # #caution# blinking

Discussion in 'Electronic and hardware generally' started by tommy06, Feb 16, 2015.

  1. tommy06

    tommy06 Active Member

    Joined:
    Jan 17, 2011
    Messages:
    130
    Balance:
    1,368Coins
    Ratings:
    +135 / 0 / -0
    Hello

    hello
    I have a an led matrix, at the moment is a message board with the code shown below. Runs perfect!

    So much I need but nciht it is only in the middle of the caution light (blinking)
    # # caution
    # # caution

    Who can change this code to me? I who be very grateful if someone could change me.
    So I would have liked.

    caution light (blinking) Matrix

    Googletranclate








    This code is a public example.
    */
    //******************************************************************************
    // visit this web page for further information about MaxMatrix library
    // https://code.google.com/p/arudino-maxmatrix-library/
    //******************************************************************************

    #include <MaxMatrix.h>
    #include <avr/pgmspace.h>
    PROGMEM prog_uchar CH[] = {
    3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space
    1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // !
    3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // "
    5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // #
    4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $
    5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // %
    5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // &
    1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // '
    3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // (
    3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // )
    5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // *
    5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // +
    2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // ,
    4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // -
    2, 8, B01100000, B01100000, B00000000, B00000000, B00000000, // .
    4, 8, B01100000, B00011000, B00000110, B00000001, B00000000, // /
    4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // 0
    3, 8, B01000010, B01111111, B01000000, B00000000, B00000000, // 1
    4, 8, B01100010, B01010001, B01001001, B01000110, B00000000, // 2
    4, 8, B00100010, B01000001, B01001001, B00110110, B00000000, // 3
    4, 8, B00011000, B00010100, B00010010, B01111111, B00000000, // 4
    4, 8, B00100111, B01000101, B01000101, B00111001, B00000000, // 5
    4, 8, B00111110, B01001001, B01001001, B00110000, B00000000, // 6
    4, 8, B01100001, B00010001, B00001001, B00000111, B00000000, // 7
    4, 8, B00110110, B01001001, B01001001, B00110110, B00000000, // 8
    4, 8, B00000110, B01001001, B01001001, B00111110, B00000000, // 9
    2, 8, B01010000, B00000000, B00000000, B00000000, B00000000, // :
    2, 8, B10000000, B01010000, B00000000, B00000000, B00000000, // ;
    3, 8, B00010000, B00101000, B01000100, B00000000, B00000000, // <
    3, 8, B00010100, B00010100, B00010100, B00000000, B00000000, // =
    3, 8, B01000100, B00101000, B00010000, B00000000, B00000000, // >
    4, 8, B00000010, B01011001, B00001001, B00000110, B00000000, // ?
    5, 8, B00111110, B01001001, B01010101, B01011101, B00001110, // @
    4, 8, B01111110, B00010001, B00010001, B01111110, B00000000, // A
    4, 8, B01111111, B01001001, B01001001, B00110110, B00000000, // B
    4, 8, B00111110, B01000001, B01000001, B00100010, B00000000, // C
    4, 8, B01111111, B01000001, B01000001, B00111110, B00000000, // D
    4, 8, B01111111, B01001001, B01001001, B01000001, B00000000, // E
    4, 8, B01111111, B00001001, B00001001, B00000001, B00000000, // F
    4, 8, B00111110, B01000001, B01001001, B01111010, B00000000, // G
    4, 8, B01111111, B00001000, B00001000, B01111111, B00000000, // H
    3, 8, B01000001, B01111111, B01000001, B00000000, B00000000, // I
    4, 8, B00110000, B01000000, B01000001, B00111111, B00000000, // J
    4, 8, B01111111, B00001000, B00010100, B01100011, B00000000, // K
    4, 8, B01111111, B01000000, B01000000, B01000000, B00000000, // L
    5, 8, B01111111, B00000010, B00001100, B00000010, B01111111, // M
    5, 8, B01111111, B00000100, B00001000, B00010000, B01111111, // N
    4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // O
    4, 8, B01111111, B00001001, B00001001, B00000110, B00000000, // P
    4, 8, B00111110, B01000001, B01000001, B10111110, B00000000, // Q
    4, 8, B01111111, B00001001, B00001001, B01110110, B00000000, // R
    4, 8, B01000110, B01001001, B01001001, B00110010, B00000000, // S
    5, 8, B00000001, B00000001, B01111111, B00000001, B00000001, // T
    4, 8, B00111111, B01000000, B01000000, B00111111, B00000000, // U
    5, 8, B00001111, B00110000, B01000000, B00110000, B00001111, // V
    5, 8, B00111111, B01000000, B00111000, B01000000, B00111111, // W
    5, 8, B01100011, B00010100, B00001000, B00010100, B01100011, // X
    5, 8, B00000111, B00001000, B01110000, B00001000, B00000111, // Y
    4, 8, B01100001, B01010001, B01001001, B01000111, B00000000, // Z
    2, 8, B01111111, B01000001, B00000000, B00000000, B00000000, // [
    4, 8, B00000001, B00000110, B00011000, B01100000, B00000000, // \ backslash
    2, 8, B01000001, B01111111, B00000000, B00000000, B00000000, // ]
    3, 8, B00000010, B00000001, B00000010, B00000000, B00000000, // hat
    4, 8, B01000000, B01000000, B01000000, B01000000, B00000000, // _
    2, 8, B00000001, B00000010, B00000000, B00000000, B00000000, // `
    4, 8, B00100000, B01010100, B01010100, B01111000, B00000000, // a
    4, 8, B01111111, B01000100, B01000100, B00111000, B00000000, // b
    4, 8, B00111000, B01000100, B01000100, B00101000, B00000000, // c
    4, 8, B00111000, B01000100, B01000100, B01111111, B00000000, // d
    4, 8, B00111000, B01010100, B01010100, B00011000, B00000000, // e
    3, 8, B00000100, B01111110, B00000101, B00000000, B00000000, // f
    4, 8, B10011000, B10100100, B10100100, B01111000, B00000000, // g
    4, 8, B01111111, B00000100, B00000100, B01111000, B00000000, // h
    3, 8, B01000100, B01111101, B01000000, B00000000, B00000000, // i
    4, 8, B01000000, B10000000, B10000100, B01111101, B00000000, // j
    4, 8, B01111111, B00010000, B00101000, B01000100, B00000000, // k
    3, 8, B01000001, B01111111, B01000000, B00000000, B00000000, // l
    5, 8, B01111100, B00000100, B01111100, B00000100, B01111000, // m
    4, 8, B01111100, B00000100, B00000100, B01111000, B00000000, // n
    4, 8, B00111000, B01000100, B01000100, B00111000, B00000000, // o
    4, 8, B11111100, B00100100, B00100100, B00011000, B00000000, // p
    4, 8, B00011000, B00100100, B00100100, B11111100, B00000000, // q
    4, 8, B01111100, B00001000, B00000100, B00000100, B00000000, // r
    4, 8, B01001000, B01010100, B01010100, B00100100, B00000000, // s
    3, 8, B00000100, B00111111, B01000100, B00000000, B00000000, // t
    4, 8, B00111100, B01000000, B01000000, B01111100, B00000000, // u
    5, 8, B00011100, B00100000, B01000000, B00100000, B00011100, // v
    5, 8, B00111100, B01000000, B00111100, B01000000, B00111100, // w
    5, 8, B01000100, B00101000, B00010000, B00101000, B01000100, // x
    4, 8, B10011100, B10100000, B10100000, B01111100, B00000000, // y
    3, 8, B01100100, B01010100, B01001100, B00000000, B00000000, // z
    3, 8, B00001000, B00110110, B01000001, B00000000, B00000000, // {
    1, 8, B01111111, B00000000, B00000000, B00000000, B00000000, // |
    3, 8, B01000001, B00110110, B00001000, B00000000, B00000000, // }
    4, 8, B00001000, B00000100, B00001000, B00000100, B00000000, // ~
    };
    int data = 8; // DIN pin of MAX7219 module
    int load = 9; // CS pin of MAX7219 module
    int clock = 10; // CLK pin of MAX7219 module
    int maxInUse = 5; //change this variable to set how many MAX7219's you'll use
    MaxMatrix m(data, load, clock, maxInUse); // define module
    byte buffer[100];
    // active sentenses
    char string1[] = " #### #### Nascar Racing @ Virtual-Oval.de - Online Racing #### #### ";
    char string2[] = " ### VO Mixed Class Winter Wreck Series 2015 #### ";
    char string3[] = " ### Class A Series @ Auto Club Speedway (SW) Night 23.11.2014 /Cup Serie der VO ";
    char string4[] = " Onboard Thomas M.- Car##06## ";
    char string5[] = " ";
    char string6[] = " #### Nascar Racing @ Virtual-Oval.de - Online Racing #### ";
    // just for tests
    char string7[] = " A B C D E F G H I J K L M N O P Q R S T U V X W Y Z ";
    char string8[] = " a b c d e f g h i j k l m n o p q r s t u v x w y z ";
    char string9[] = " 1 2 3 4 5 6 7 8 9 0 - = ";
    char string10[] = " ! @ # $ % ¨ & * ( ) _ + ";
    char string11[] = " ' , . ; ~ ] ´ [ | < > : ^ } ` { / ? ";
    void setup(){
    m.init(); // module initialize
    m.setIntensity(0); // dot matix intensity 0-15
    Serial.begin(9600); // serial communication initialize
    }
    void loop(){
    /*
    // this is the code if you want to entering a message via serial console
    while (Serial.available() > 0){
    byte c = Serial.read();
    Serial.println(c, DEC);
    printCharWithShift(c, 100);
    }
    delay(100);
    m.shiftLeft(false, true);
    */

    // print the active sentences
    printStringWithShift(string1, 100);
    printStringWithShift(string2, 100);
    printStringWithShift(string3, 100);
    printStringWithShift(string4, 100);
    printStringWithShift(string5, 100);
    printStringWithShift(string6, 100);
    // print sentences just for tests
    //printStringWithShift(string7, 100);
    //printStringWithShift(string8, 100);
    //printStringWithShift(string9, 100);
    //printStringWithShift(string10, 100);
    //printStringWithShift(string11, 100);
    }
    void printCharWithShift(char c, int shift_speed){
    if (c < 32) return;
    c -= 32;
    memcpy_P(buffer, CH + 7*c, 7);
    m.writeSprite(41, 0, buffer);
    m.setColumn(41 + buffer[0], 0);

    for (int i=0; i<buffer[0]+1; i++)
    {
    delay(shift_speed);
    m.shiftLeft(false, false);
    }
    }
    void printStringWithShift(char* s, int shift_speed){
    while (*s != 0){
    printCharWithShift(*s, shift_speed);
    s++;
    }
    }
    • Informative Informative x 1
    • Creative Creative x 1
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  3. tommy06

    tommy06 Active Member

    Joined:
    Jan 17, 2011
    Messages:
    130
    Balance:
    1,368Coins
    Ratings:
    +135 / 0 / -0
    Can someone help me because nobody?
    40x8 led matrix

    Text in the middle

    ## Caution ## < /flashes 2-4 times

    (Led animation)

    ## Slow Down ## < /flashes 2-4 times

    loop
    ##Caution ##

    .. .................

    ............................

    I have problem with the code !!
  4. Kirk

    Kirk Member

    Joined:
    May 19, 2014
    Messages:
    91
    Occupation:
    Sr Software Engineer
    Location:
    Texas
    Balance:
    15,087Coins
    Ratings:
    +114 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor
    Please pay attention to the "writeSprite" routine (used by "printCharWithShift" in your code).
    If you create an array of, oh, say, 40 bytes, centered the word "CAUTION" based on the fonts in array "CH", called "writeSprite" the that buffer, and once every two seconds XOR'd all 40 bytes by 0xFF, that would do the trick.
    Does the word "slow down" entirely fit in the 40 display, or does it need to scroll?
    To modify the printCharWithShift routine to have scrolling inverted characters, on inversion, simply XOR'ing as you do if you want it inverted. Say "uint8_t Flip = ((millis() / 512) & 1) ? 0x00 : 0xFF;" and after "memcpy_P(buffer, CH + 7*c, 7);" add "for (int i = 0; i < 7; i++) { buffer ^= Flip; }".
    That would look nicer if you calculated Flip in printStringWithShift instead, passing that into "printCharWithShift", so you don't get characters flipping right in the middle of strings."
    Never worked with the maxmatrix displays. The RGB ones (like SmartMatrix / Teensy) are awesome, though.
    • Like Like x 1
    • Informative Informative x 1
  5. tommy06

    tommy06 Active Member

    Joined:
    Jan 17, 2011
    Messages:
    130
    Balance:
    1,368Coins
    Ratings:
    +135 / 0 / -0
    Thanks Kirk :thumbs :thumbs:thumbs :cheers:D
    of www.xsimulator.net for adriuno uno code.

    thank you for the great code, exactly what I wanted:cheers:thumbs

    • Like Like x 2
    • Winner Winner x 1
  6. tommy06

    tommy06 Active Member

    Joined:
    Jan 17, 2011
    Messages:
    130
    Balance:
    1,368Coins
    Ratings:
    +135 / 0 / -0
    all led testing :D
    In the code I need to (m.set Intensity (0); // dot matrix intensity 0-15) Change to = 0 :D
    I have 5 are bright for the Camara.


    really thank you Kirk:thumbs

    Nascartv20
    Tom
    • Like Like x 2
    • Creative Creative x 1