Jump to content
ELFORUM - Forumul electronistilor
vasile eugen

Font cu matrice 5x7

Recommended Posts

Salutare. Detin citeva matrice de 5x7 si integratele de comanda MAX7219.Din exemple luate de pe net am reusit sa fac comanda ,dar fontul este mai mare.Textul este doar pe o matrice,cu care am incercat sa fac testele.Mai jos am codul cu care am testat. Sau un cod mai simplu pentru a testa este OK. Optinea este pentru un test scrool.Un sfat ajutor este bine venit.Multumesc.

led matrix.txt

Link to comment
Share on other sites

const static byte alphabetBitmap[41][6]={
	{0x7E,0x81,0x81,0x81,0x7E,0x0}, //0
	{0x4,0x82,0xFF,0x80,0x0,0x0},  //1
	{0xE2,0x91,0x91,0x91,0x8E,0x0},//2
	{0x42,0x89,0x89,0x89,0x76,0x0},//3
	{0x1F,0x10,0x10,0xFF,0x10,0x0},//4
	{0x8F,0x89,0x89,0x89,0x71,0x0},//5
	{0x7E,0x89,0x89,0x89,0x71,0x0},//6
	{0x1,0x1,0xF9,0x5,0x3,0x0},//7
	{0x76,0x89,0x89,0x89,0x76,0x0},//8
	{0x8E,0x91,0x91,0x91,0x7E,0x0},//9
	{0x0,0x0,0x0,0x0,0x0,0x0},// blank space
	{0x0,0x0,0x90,0x0,0x0,0x0}, //:
	{0x0,0x10,0x10,0x10,0x10,0x0},// -
	{0x0,0x0,0x80,0x0,0x0,0x0},// .
	{0xFC,0x9,0x11,0x21,0xFC,0x0},//Ñ
	{0xFE,0x11,0x11,0x11,0xFE,0x0},//A
	{0xFF,0x89,0x89,0x89,0x76,0x0},//B
	{0x7E,0x81,0x81,0x81,0x42,0x0},//C
	{0xFF,0x81,0x81,0x81,0x7E,0x0},//D
	{0xFF,0x89,0x89,0x89,0x81,0x0},//E
	{0xFF,0x9,0x9,0x9,0x1,0x0},//F
	{0x7E,0x81,0x81,0x91,0x72,0x0},//G
	{0xFF,0x8,0x8,0x8,0xFF,0x0},//H
	{0x0,0x81,0xFF,0x81,0x0,0x0},//I
	{0x60,0x80,0x80,0x80,0x7F,0x0},//J
	{0xFF,0x18,0x24,0x42,0x81,0x0},//K
	{0xFF,0x80,0x80,0x80,0x80,0x0},//L
	{0xFF,0x2,0x4,0x2,0xFF,0x0},//M
	{0xFF,0x2,0x4,0x8,0xFF,0x0},//N
	{0x7E,0x81,0x81,0x81,0x7E,0x0},//O
	{0xFF,0x11,0x11,0x11,0xE,0x0},//P
	{0x7E,0x81,0x81,0xA1,0x7E,0x80},//Q
	{0xFF,0x11,0x31,0x51,0x8E,0x0},//R
	{0x46,0x89,0x89,0x89,0x72,0x0},//S
	{0x1,0x1,0xFF,0x1,0x1,0x0},//T
	{0x7F,0x80,0x80,0x80,0x7F,0x0},//U
	{0x3F,0x40,0x80,0x40,0x3F,0x0},//V
	{0x7F,0x80,0x60,0x80,0x7F,0x0},//W
	{0xE3,0x14,0x8,0x14,0xE3,0x0},//X
	{0x3,0x4,0xF8,0x4,0x3,0x0},//Y
	{0xE1,0x91,0x89,0x85,0x83,0x0}//Z
};

Astea trebuiesc modificate pentru fontul dorit.Am eu toate caracterele pentru matrici 5x7,daca doriti.

Link to comment
Share on other sites

Revin din nou la acest subiect.Pe placa de text am montat acum doua integrate max7219 si doua matrici.Testele care le-am inceput suntdin acest link:

http://tronixstuff.com/2013/10/11/tutorial-arduino-max7219-led-display-driver-ic/

Inceputul programului din care am facut proba este:

// based on an orginal sketch by Arduino forum member "danigom"
#include <avr/pgmspace.h>
#include <LedControl.h>

const int numDevices = 2;      // number of MAX7219s used
const long scrollDelay = 75;   // adjust scrolling speed

unsigned long bufferLong [14] = {0}; 

LedControl lc=LedControl(12,11,10,numDevices);

prog_uchar scrollText[] PROGMEM ={
    "  THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG 1234567890 the quick brown fox jumped over the lazy dog   \0"};

void setup(){
    for (int x=0; x<numDevices; x++){
        lc.shutdown(x,false);       //The MAX72XX is in power-saving mode on startup
        lc.setIntensity(x,8);       // Set the brightness to default value
        lc.clearDisplay(x);         // and clear the display
    }
}

void loop(){ 
    scrollMessage(scrollText);
    scrollFont();
}

Intrebarea mea este,pentru definirea unui font exemplul de mai jos trebuie sa imi de cifra 8?

 

B01110000, //8
    B10001000,
    B10001000,
    B01110000,
    B10001000,
    B10001000,
    B01110000,
    6,
Daca las codul complect imi porneste scrolingul din cod.

Va rog sa formatati codul folosind butonul "<>" din editor!

Link to comment
Share on other sites

/* Include the HCMAX7219 and SPI library */
#include <HCMAX7219.h>
#include "SPI.h"

/* Set the LOAD (CS) digital pin number*/
#define LOAD 10
 
/* Create an instance of the library */
HCMAX7219 HCMAX7219(LOAD);


void setup() 
{       
}


/* Main program */
void loop() 
{
  byte Loopcounter;
  int Position;

  /* Clear the output buffer */
  HCMAX7219.Clear();
  
  /* SCROLL SOME TEXT 2 TIMES BEFORE MOVING ON */
  for (Loopcounter = 0; Loopcounter <= 2; Loopcounter++)
  {
    for(Position=0; Position <= 300; Position++)
    {
      HCMAX7219.printMatrix("VASILE EUGEN ", Position);
      HCMAX7219.Refresh();
      delay(80);
    }
  
  }
 
  
}

Cu acest cod am reusit sa fac din ce mi-am dorit,dar am folosit o matrice de 7 rinduri si 8 coloane.Sper ca am atasat acum bine codul cu aceste semne <>

Edited by vasile eugen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines