changement de police de caractere dans un skecth

bonjour
j' utilise ce sketch pour afficher des caractères en périphérie de mon led cube 8x8x8:

 effect_path_text (2500, "texte a afficher ");

// ==========================================================================================
//   Effect functions
// ==========================================================================================


void effect_path_text (int delay, char *str)
{
  	fill(0x00);
        int z, i,ii;
	z = 4;
	unsigned char path[28];
	font_getpath(0,path,28);
	unsigned char chr[5];
	unsigned char stripe;
	
	
        while (*str)
	{
		font_getchar(*str++, chr);
		
		for (ii=0;ii<5;ii++)
		{
			//stripe = font[(chr*5)+ii];
			stripe = chr[ii];
			
			for (z=0;z<8;z++)
			{
				if ((stripe>>(7-z)) & 0x01)
				{
					setvoxel(0,7,z);
				} else
				{
					clrvoxel(0,7,z);
				}
				
			}
			effect_pathmove(path, 28);
			delay_ms(delay);
		}
	
		effect_pathmove(path, 28);
		delay_ms(delay);
	}
	for (i=0;i<28;i++)
	{
		effect_pathmove(path, 28);
		delay_ms(delay);
	}
}

je voudrais changer la police de caractère (car celle-ci n' est pas terrible)
j'ai récupéré un petit soft qui me donne les codes hexa pour les font que je veux afficher ...(La curiosite est un vilain defaut...)
c' est tout simple à utiliser

mais comment faire pour insérer les font que je crée dans mon sketch ?

dracub:
bonjour
j' utilise ce sketch pour afficher des caractères en périphérie de mon led cube 8x8x8:

effect_path_text (2500, "texte a afficher ");

...
je voudrais changer la police de caractère (car celle-ci n' est pas terrible)
j'ai récupéré un petit soft qui me donne les codes hexa pour les font que je veux afficher ...(La curiosite est un vilain defaut...)
c' est tout simple à utiliser

mais comment faire pour insérer les font que je crée dans mon sketch ?

Bonjour
Déjà mettre le sketch entre les balises ``
ensuite le sketch n'est pas complet et il manque justement de voir où est definie la matrice des # caracteres constituant la police

j' ai plusieurs matrices mais je ne les ai pas mis dans le post
ex:

const unsigned char font[455] = {
0x3e,0x51,0x49,0x45,0x3e,0x00,0x42,0x7f,0x40,0x00, // 01
0x42,0x61,0x51,0x49,0x46,0x21,0x41,0x45,0x4b,0x31, // 23
0x18,0x14,0x12,0x7f,0x10,0x27,0x45,0x45,0x45,0x39, // 45
...
...
...
0x32,0x49,0x79,0x41,0x3e,0x7e,0x11,0x11,0x11,0x7e, // @A
0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22, // BC
0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41, // DE
0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a, // FG
...
};
ect...
j' ai récupéré aussi des fonts sur: GitHub - wildstray/ht1632c: HT1632C dotmatrix display library for Arduino (and AVR/ARM/PIC clones)
mais pour les essayer il faut que j' arrive à les définires dans mon programmes et c'est cela que je n' arrive pas à faire
Je ne connais pas la syntaxe ...
Ou alors existe t'il un tuto qui explique tout cela ?

par contre je ne comprend ce que tu veux dire par , "Déjà mettre le sketch entre les balises "

Tu edites ton premier message et tu mets le code entre les balises qui vont bien avec le bouton # de la fenetre d'edition

ha ok j' ai compris (j'suis un long à la détente oups )
alors voila

 effect_path_text (2500, "texte a afficher ");

// ==========================================================================================
//   Effect functions
// ==========================================================================================


void effect_path_text (int delay, char *str)
{
     fill(0x00);
        int z, i,ii;
   z = 4;
   unsigned char path[28];
   font_getpath(0,path,28);
   unsigned char chr[5];
   unsigned char stripe;
   
   
        while (*str)
   {
      font_getchar(*str++, chr);
      
      for (ii=0;ii<5;ii++)
      {
         //stripe = font[(chr*5)+ii];
         stripe = chr[ii];
         
         for (z=0;z<8;z++)
         {
            if ((stripe>>(7-z)) & 0x01)
            {
               setvoxel(0,7,z);
            } else
            {
               clrvoxel(0,7,z);
            }
            
         }
         effect_pathmove(path, 28);
         delay_ms(delay);
      }
   
      effect_pathmove(path, 28);
      delay_ms(delay);
   }
   for (i=0;i<28;i++)
   {
      effect_pathmove(path, 28);
      delay_ms(delay);
   }
}

Sauf que ton premier message c'est finalement moi qui l'ai modifié alors que tu pouvais le faire toi-même avec la fonction "modify" ..... :grin:

oups et oups
désolé ... :sweat_smile:

Au moins tu auras compris :wink:

Bonne continuation sur ton sujet.

dracub:
ha ok j' ai compris (j'suis un long à la détente oups )
alors voila

 effect_path_text (2500, "texte a afficher ");

...

Bonsoir
Oui , mais... non ce n'est pas le code complet
on ne voit pas où/comment est "stockée" la matrice utilisée actuellement
déjà pour comprendre et ensuite pour voir si il est simple d'utiliser ton generateur de "fontes"

Edit de Jean-François : Ralalala.... si même les "anciens" commence à avoir de la peine avec les balises, on va pas s'en sortir..... :grin:

alors voila
Je te met le programme complet, évidement j' ai enlevé tous les effets qui ne concerne pas le post ( de toute façon les effets que j' ai enlevé fonctionnes très bien...
et à force de les bidouiller j' arrive à faire des trucs qui me plaisent
par contre il y a aussi une liste de "caractères bitmaps [37] [8]" je ne sais pas comment on s' en sert ( je suppose de la même façon que la police de caractère)

#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <avr/io.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define AXIS_X 1
#define AXIS_Y 2
#define AXIS_Z 3
#define AXIS_X 0x78
#define AXIS_Y 0x79
#define AXIS_Z 0x7a
#define CUBE_SIZE 8
#define CUBE_BYTES 64


volatile unsigned char cube[CUBE_SIZE][CUBE_SIZE];
volatile int current_layer = 0;
volatile unsigned char fb[CUBE_SIZE][CUBE_SIZE];
volatile unsigned char pgm_mode;
int r,w;

void setup(){

  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  int i;
  for(i=0; i<14; i++)
  pinMode(i, OUTPUT);

  
  DDRC = 0xff;
  PORTC = 0x00;
  TCCR2A = 0x00;
  TCCR2B = 0x00;
  TCCR2A |= (0x01 << WGM21);
  OCR2A = 10; 
  TCNT2 = 0x00; 
  TCCR2B |= (0x01 << CS22) | (0x01 << CS21); 
  TIMSK2 |= (0x01 << OCIE2A);
}

ISR (TIMER2_COMPA_vect){
  sei();
  int i;

    
  PORTC = 0x00;
  PORTB &= 0x0f;
  PORTB |= 0x08; 
    
  for (i=0; i<8; i++){
    PORTD = cube[current_layer][i];
    PORTB = (PORTB & 0xF8) | (0x07 & (i+1));
  }
  
    PORTB &= 0b00110111;
  
    if (current_layer < 6){
      PORTC = (0x01 << current_layer);
  }
    else 
        if (current_layer == 6){
          digitalWrite(12, HIGH);
      }
        else{
          digitalWrite(13, HIGH);
      }
  
        current_layer++;
  
        if (current_layer == 8)
          current_layer = 0;
}

void loop()
{
  int i,x,y,z;
  w=0;
  while (true)
  {
 
  
// ==========================================================================================
//   Effects
// ==========================================================================================

    fill(0x00); delay_ms(1000);
    
    
    effect_path_text (2500, "bonjour comment allez vous?");
    effect_path_text (2500, "essai de programme pour le forum");     
 
    
    delay_ms(2000);

    
  }
}

// ==========================================================================================
//   Effect functions
// ==========================================================================================


// ==========================================================================================
//   Draw functions
// ==========================================================================================




void setvoxel(int x, int y, int z)
{
	if (inrange(x,y,z))
		cube[z][y] |= (1 << x);
}

void clrvoxel(int x, int y, int z)
{
	if (inrange(x,y,z))
		cube[z][y] &= ~(1 << x);
}

    unsigned char inrange(int x, int y, int z)
{
	if (x >= 0 && x < 8 && y >= 0 && y < 8 && z >= 0 && z < 8)
	{
		return 0x01;
	} else
	{
		return 0x00;
	}
}

unsigned char getvoxel(int x, int y, int z)
{
	if (inrange(x,y,z))
	{
		if (cube[z][y] & (1 << x))
		{
			return 0x01;
		} else
		{
			return 0x00;
		}
	} else
	{
		return 0x00;
	}
}

void altervoxel(int x, int y, int z, int state)
{
	if (state == 1)
	{
		setvoxel(x,y,z);
	} else
	{
		clrvoxel(x,y,z);
	}
}

void flpvoxel(int x, int y, int z)
{
	if (inrange(x, y, z))
		cube[z][y] ^= (1 << x);
}

void argorder(int ix1, int ix2, int *ox1, int *ox2)
{
	if (ix1>ix2)
	{
		int tmp;
		tmp = ix1;
		ix1= ix2;
		ix2 = tmp;
	}
	*ox1 = ix1;
	*ox2 = ix2;
}

void setplane_z (int z)
{
	int i;
	if (z>=0 && z<8)
	{
		for (i=0;i<8;i++)
			cube[z][i] = 0xff;
	}
}

void clrplane_z (int z)
{
	int i;
	if (z>=0 && z<8)
	{
		for (i=0;i<8;i++)
			cube[z][i] = 0x00;
	}
}

void setplane_x (int x)
{
	int z;
	int y;
	if (x>=0 && x<8)
	{
		for (z=0;z<8;z++)
		{
			for (y=0;y<8;y++)
			{
				cube[z][y] |= (1 << x);
			}
		}
	}
}

void clrplane_x (int x)
{
	int z;
	int y;
	if (x>=0 && x<8)
	{
		for (z=0;z<8;z++)
		{
			for (y=0;y<8;y++)
			{
				cube[z][y] &= ~(1 << x);
			}
		}
	}
}

void setplane_y (int y)
{
	int z;
	if (y>=0 && y<8)
	{
		for (z=0;z<8;z++)
			cube[z][y] = 0xff;
	} 
}

void clrplane_y (int y)
{
	int z;
	if (y>=0 && y<8)
	{
		for (z=0;z<8;z++)
			cube[z][y] = 0x00; 
	}
}

void setplane (char axis, unsigned char i)
{
    switch (axis)
    {
        case AXIS_X:
            setplane_x(i);
            break;
        
       case AXIS_Y:
            setplane_y(i);
            break;

       case AXIS_Z:
            setplane_z(i);
            break;
    }
}

void clrplane (char axis, unsigned char i)
{
    switch (axis)
    {
        case AXIS_X:
            clrplane_x(i);
            break;
        
       case AXIS_Y:
            clrplane_y(i);
            break;

       case AXIS_Z:
            clrplane_z(i);
            break;
    }
}

void fill (unsigned char pattern)
{
	int z;
	int y;
	for (z=0;z<8;z++)
	{
		for (y=0;y<8;y++)
		{
			cube[z][y] = pattern;
		}
	}
}

void delay_ms(uint16_t x)
{
  uint8_t y, z;
  for ( ; x > 0 ; x--){
    for ( y = 0 ; y < 90 ; y++){
      for ( z = 0 ; z < 6 ; z++){
        asm volatile ("nop");
      }
    }
  }
}




// ==========================================================================================
//   3D
// ==========================================================================================

// ==========================================================================================
//   draw
// ==========================================================================================

void tmpsetvoxel(int x, int y, int z)
{
	if (inrange(x,y,z))
		fb[z][y] |= (1 << x);
}

void tmpfill (unsigned char pattern)
{
	int z;
	int y;
	for (z=0;z<8;z++)
	{
		for (y=0;y<8;y++)
		{
			fb[z][y] = pattern;
		}
	}
}

void tmp2cube (void)
{	
	int y, z;
	for (z=0;z<8;z++)
	{
		for (y=0;y<8;y++)
		{
			cube[z][y] = fb[z][y];
		}
	}
}

// ==========================================================================================
//   draw 3D
// ==========================================================================================


// ==========================================================================================
//   EFFECT BITMAP
// ==========================================================================================

void effect_pathmove (unsigned char *path, int length)
{
	int i,z;
	unsigned char state;
	
	for (i=(length-1);i>=1;i--)
	{
		for (z=0;z<8;z++)
		{
		
			state = getvoxel(((path[(i-1)]>>4) & 0x0f), (path[(i-1)] & 0x0f), z);
			altervoxel(((path[i]>>4) & 0x0f), (path[i] & 0x0f), z, state);
		}
	}
	for (i=0;i<8;i++)
		clrvoxel(((path[0]>>4) & 0x0f), (path[0] & 0x0f),i);
}




void effect_path_text (int delay, char *str)
{
  	fill(0x00);
        int z, i,ii;
	z = 4;
	unsigned char path[28];
	font_getpath(0,path,28);
	unsigned char chr[5];
	unsigned char stripe;
	
	
        while (*str)
	{
		font_getchar(*str++, chr);
		
		for (ii=0;ii<5;ii++)
		{
			//stripe = font[(chr*5)+ii];
			stripe = chr[ii];
			
			for (z=0;z<8;z++)
			{
				if ((stripe>>(7-z)) & 0x01)
				{
					setvoxel(0,7,z);
				} else
				{
					clrvoxel(0,7,z);
				}
				
			}
			effect_pathmove(path, 28);
			delay_ms(delay);
		}
	
		effect_pathmove(path, 28);
		delay_ms(delay);
	}
	for (i=0;i<28;i++)
	{
		effect_pathmove(path, 28);
		delay_ms(delay);
	}
}

void effect_path_bitmap (int delay, char bitmap, int iterations)
{
	int z, i, ii;
	z = 4;
	unsigned char path[28];
	font_getpath(0,path,28);
	
	for (i=0; i < iterations; i++)
	{	
		for (ii=0;ii<8;ii++)
		{		
			for (z=0;z<8;z++)
			{
				if (font_getbitmappixel(bitmap,(7-z),ii))
				{
					setvoxel(0,7,z);
				} else
				{
					clrvoxel(0,7,z);
				}
				
			}
			delay_ms(delay);
			effect_pathmove(path, 28);
		}
	
		for (ii=0;ii<20;ii++)
		{
			delay_ms(delay);
			effect_pathmove(path, 28);
		}
	}
	for (ii=0;ii<10;ii++)
	{
		delay_ms(delay);
		effect_pathmove(path, 28);
	}
}

deuxième partie du post car je dépasse le nombre de caractères ....

// ==========================================================================================
//   font
// ==========================================================================================

        const unsigned char font[455] = {
	0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,	//  !
	0x00,0x03,0x00,0x03,0x00,0x14,0x7f,0x14,0x7f,0x14,	// "#
	0x24,0x2a,0x7f,0x2a,0x12,0x23,0x13,0x08,0x64,0x62,	// $%
	0x36,0x49,0x55,0x22,0x50,0x00,0x05,0x03,0x00,0x00,	// &'
	0x00,0x1c,0x22,0x41,0x00,0x00,0x41,0x22,0x1c,0x00,	// ()
	0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,	// *+
	0x00,0x50,0x30,0x00,0x00,0x08,0x08,0x08,0x08,0x08,	// ,-
	0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02,	// ./
	0x3e,0x51,0x49,0x45,0x3e,0x00,0x42,0x7f,0x40,0x00,	// 01
	0x42,0x61,0x51,0x49,0x46,0x21,0x41,0x45,0x4b,0x31,	// 23
	0x18,0x14,0x12,0x7f,0x10,0x27,0x45,0x45,0x45,0x39,	// 45
	0x3c,0x4a,0x49,0x49,0x30,0x01,0x71,0x09,0x05,0x03,	// 67
	0x36,0x49,0x49,0x49,0x36,0x06,0x49,0x49,0x29,0x1e,	// 89
	0x00,0x36,0x36,0x00,0x00,0x00,0x56,0x36,0x00,0x00,	// :;
	0x08,0x14,0x22,0x41,0x00,0x14,0x14,0x14,0x14,0x14,	// <=
	0x00,0x41,0x22,0x14,0x08,0x02,0x01,0x51,0x09,0x06,	// >?
	0x32,0x49,0x79,0x41,0x3e,0x7e,0x11,0x11,0x11,0x7e,	// @A
	0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22,	// BC
	0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41,	// DE
	0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a,	// FG
	0x7f,0x08,0x08,0x08,0x7f,0x00,0x41,0x7f,0x41,0x00,	// HI
	0x20,0x43,0x41,0x3f,0x00,0x7f,0x08,0x14,0x22,0x41,	// JK
	0x7f,0x40,0x40,0x40,0x40,0x7f,0x02,0x0c,0x02,0x7f,	// LM
	0x7f,0x04,0x08,0x10,0x7f,0x3e,0x41,0x41,0x41,0x3e,	// NO
	0x7f,0x09,0x09,0x09,0x06,0x3e,0x41,0x51,0x21,0x5e,	// PQ
	0x7f,0x09,0x19,0x29,0x46,0x46,0x49,0x49,0x49,0x31,	// RS
	0x01,0x01,0x7f,0x01,0x01,0x3f,0x40,0x40,0x40,0x3f,	// TU
	0x1f,0x20,0x40,0x20,0x1f,0x3f,0x40,0x38,0x40,0x3f,	// VW
	0x63,0x14,0x08,0x14,0x63,0x07,0x08,0x70,0x08,0x07,	// XY
	0x61,0x51,0x49,0x45,0x43,0x00,0x7f,0x41,0x41,0x00,	// Z[
	0x02,0x04,0x08,0x10,0x20,0x00,0x41,0x41,0x7f,0x00,	// \]
	0x04,0x02,0x01,0x02,0x04,0x40,0x40,0x40,0x40,0x40,	// ^_
	0x00,0x01,0x02,0x04,0x00,0x20,0x54,0x54,0x54,0x78,	// `a
	0x7f,0x48,0x44,0x44,0x38,0x38,0x44,0x44,0x44,0x20,	// bc
	0x38,0x44,0x44,0x48,0x7f,0x38,0x54,0x54,0x54,0x18,	// de
	0x08,0x7e,0x09,0x01,0x02,0x0c,0x52,0x52,0x52,0x3e,	// fg
	0x7f,0x08,0x04,0x04,0x78,0x00,0x44,0x7d,0x40,0x00,	// hi
	0x20,0x40,0x44,0x3d,0x00,0x7f,0x10,0x28,0x44,0x00,	// jk
	0x00,0x41,0x7f,0x40,0x00,0x7c,0x04,0x18,0x04,0x78,	// lm
	0x7c,0x08,0x04,0x04,0x78,0x38,0x44,0x44,0x44,0x38,	// no
	0x7c,0x14,0x14,0x14,0x08,0x08,0x14,0x14,0x18,0x7c,	// pq
	0x7c,0x08,0x04,0x04,0x08,0x48,0x54,0x54,0x54,0x20,	// rs
	0x04,0x3f,0x44,0x40,0x20,0x3c,0x40,0x40,0x20,0x7c,	// tu
	0x1c,0x20,0x40,0x20,0x1c,0x3c,0x40,0x30,0x40,0x3c,	// vw
	0x44,0x28,0x10,0x28,0x44,0x0c,0x50,0x50,0x50,0x3c,	// xy
	0x44,0x64,0x54,0x4c,0x44				// z
};
        const unsigned char bitmaps[37][8] = {
	{0xc3,0xc3,0x00,0x18,0x18,0x81,0xff,0x7e}, // smiley 3 small
	{0x3c,0x42,0x81,0x81,0xc3,0x24,0xa5,0xe7}, // Omega
	{0x00,0x04,0x06,0xff,0xff,0x06,0x04,0x00},  // Arrow
	{0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81}, // X
	{0xBD,0xA1,0xA1,0xB9,0xA1,0xA1,0xA1,0x00}, // ifi
	{0xEF,0x48,0x4B,0x49,0x4F,0x00,0x00,0x00}, // TG
        {0x08,0x04,0x02,0x01,0x01,0x01,0x01,0x01}, // lower sinewave
        {0x10,0x20,0x40,0x80,0x80,0x02,0x02,0x02}, // upper sinewave
        {0x99,0x24,0x42,0x99,0x99,0x42,0x24,0x99}, //  round pattern
        {0xFF,0x81,0xBD,0xA5,0xA5,0xBD,0x81,0xFF}, //  box pattern inner
        {0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA}, //  fine checkers
        {0x33,0x33,0xCC,0xCC,0x33,0x33,0xCC,0xCC}, //  big checkers
        {0x42,0xC3,0x24,0x18,0x18,0x24,0xC3,0x42}, // 12 X pattern
        {0xFD,0x85,0xB5,0xA5,0xA5,0xBD,0x81,0xFF}, //  sprial
        {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, //  8x8 block
        {0xFF,0x7E,0x7E,0x7E,0x7E,0x42,0x24,0x18}, //  bullet Right
        {0x18,0x18,0x3C,0x66,0x66,0x3C,0x18,0x18}, //  chain link
        {0x78,0x78,0x18,0xFF,0xFF,0x0C,0x3C,0x3C}, //  cactus
        {0xF2,0x82,0x12,0x3A,0x10,0xC0,0xC4,0x0E}, //  tetris
        {0x7F,0x84,0xA7,0x84,0xA7,0x84,0x7F,0x00}, // 19 pacman ghost
        {0x3C,0x42,0x81,0xA1,0x89,0x95,0xA5,0x42}, // 20 pacman
        {0x07,0x2F,0x1C,0x3E,0x3C,0x30,0x30,0x30}, //  gun
        {0x5A,0x99,0x00,0x18,0x18,0x00,0x18,0x18}, //  gun bullets
        {0x82,0x41,0x82,0x41,0x82,0x41,0x82,0x41}, //  checkers edges
        {0x00,0x01,0x06,0x7E,0xDF,0x7E,0x06,0x01}, //  rocket
        {0x04,0x0F,0x1F,0x3C,0x3C,0x1F,0x0F,0x04}, //  house
        {0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00}, //  vertical stripes
        {0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55}, //  horizontal strips
        {0x49,0x92,0x24,0x49,0x92,0x24,0x49,0x92}, //  diag strips left
        {0x92,0x49,0x24,0x92,0x49,0x24,0x92,0x49}, //  diag strips rights
        {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}, //  arrow shaft
        {0x18,0x18,0x3C,0x5A,0x99,0x3C,0x42,0x81}, //  arrow tail}
        {0x18,0x3C,0x7E,0xFF,0x18,0x18,0x18,0x18}, //  arrow head
        {0x81,0x42,0x24,0x18,0x81,0x42,0x24,0x18}, //  carrots L
        {0x18,0x24,0x42,0x81,0x18,0x24,0x42,0x81}, //  carrots R
        {0x81,0x42,0x24,0x99,0x5A,0x3C,0x18,0x18}, //  tail good
        {0x18,0x18,0x18,0x18,0xFF,0x7E,0x3C,0x18}  // 36 head good



};
        const unsigned char paths[44] = {
        0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x10,0x20,0x30,
        0x40,0x50,0x60,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
        0x67,0x57,0x47,0x37,0x27,0x17,0x04,0x03,0x12,0x21,0x30,
        0x40,0x51,0x62,0x73,0x74,0x65,0x56,0x47,0x37,0x26,0x15}; // circle, len 16, offset 28

void font_getpath (unsigned char path, unsigned char *destination, int length)
{
	int i;
	int offset = 0;
	
	if (path == 1)
		offset=28;
	
	for (i = 0; i < length; i++)
	  destination[i] = paths[i+offset];
}

void font_getchar (char chr, unsigned char dst[5])
{
	int i;
	chr -= 32;

        unsigned char font[455] = {
	0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,	//  !
	0x00,0x03,0x00,0x03,0x00,0x14,0x7f,0x14,0x7f,0x14,	// "#
	0x24,0x2a,0x7f,0x2a,0x12,0x23,0x13,0x08,0x64,0x62,	// $%
	0x36,0x49,0x55,0x22,0x50,0x00,0x05,0x03,0x00,0x00,	// &'
	0x00,0x1c,0x22,0x41,0x00,0x00,0x41,0x22,0x1c,0x00,	// ()
	0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,	// *+
	0x00,0x50,0x30,0x00,0x00,0x08,0x08,0x08,0x08,0x08,	// ,-
	0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02,	// ./
	0x3e,0x51,0x49,0x45,0x3e,0x00,0x42,0x7f,0x40,0x00,	// 01
	0x42,0x61,0x51,0x49,0x46,0x21,0x41,0x45,0x4b,0x31,	// 23
	0x18,0x14,0x12,0x7f,0x10,0x27,0x45,0x45,0x45,0x39,	// 45
	0x3c,0x4a,0x49,0x49,0x30,0x01,0x71,0x09,0x05,0x03,	// 67
	0x36,0x49,0x49,0x49,0x36,0x06,0x49,0x49,0x29,0x1e,	// 89
	0x00,0x36,0x36,0x00,0x00,0x00,0x56,0x36,0x00,0x00,	// :;
	0x08,0x14,0x22,0x41,0x00,0x14,0x14,0x14,0x14,0x14,	// <=
	0x00,0x41,0x22,0x14,0x08,0x02,0x01,0x51,0x09,0x06,	// >?
	0x32,0x49,0x79,0x41,0x3e,0x7e,0x11,0x11,0x11,0x7e,	// @A
	0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22,	// BC
	0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41,	// DE
	0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a,	// FG
	0x7f,0x08,0x08,0x08,0x7f,0x00,0x41,0x7f,0x41,0x00,	// HI
	0x20,0x40,0x41,0x3f,0x01,0x7f,0x08,0x14,0x22,0x41,	// JK
	0x7f,0x40,0x40,0x40,0x40,0x7f,0x02,0x0c,0x02,0x7f,	// LM
	0x7f,0x04,0x08,0x10,0x7f,0x3e,0x41,0x41,0x41,0x3e,	// NO
	0x7f,0x09,0x09,0x09,0x06,0x3e,0x41,0x51,0x21,0x5e,	// PQ
	0x7f,0x09,0x19,0x29,0x46,0x46,0x49,0x49,0x49,0x31,	// RS
	0x01,0x01,0x7f,0x01,0x01,0x3f,0x40,0x40,0x40,0x3f,	// TU
	0x1f,0x20,0x40,0x20,0x1f,0x3f,0x40,0x38,0x40,0x3f,	// VW
	0x63,0x14,0x08,0x14,0x63,0x07,0x08,0x70,0x08,0x07,	// XY
	0x61,0x51,0x49,0x45,0x43,0x00,0x7f,0x41,0x41,0x00,	// Z[
	0x02,0x04,0x08,0x10,0x20,0x00,0x41,0x41,0x7f,0x00,	// \]
	0x04,0x02,0x01,0x02,0x04,0x40,0x40,0x40,0x40,0x40,	// ^_
	0x00,0x01,0x02,0x04,0x00,0x20,0x54,0x54,0x54,0x78,	// `a
	0x7f,0x48,0x44,0x44,0x38,0x38,0x44,0x44,0x44,0x20,	// bc
	0x38,0x44,0x44,0x48,0x7f,0x38,0x54,0x54,0x54,0x18,	// de
	0x08,0x7e,0x09,0x01,0x02,0x0c,0x52,0x52,0x52,0x3e,	// fg
	0x7f,0x08,0x04,0x04,0x78,0x00,0x44,0x7d,0x40,0x00,	// hi
	0x20,0x40,0x44,0x3d,0x00,0x7f,0x10,0x28,0x44,0x00,	// jk
	0x00,0x41,0x7f,0x40,0x00,0x7c,0x04,0x18,0x04,0x78,	// lm
	0x7c,0x08,0x04,0x04,0x78,0x38,0x44,0x44,0x44,0x38,	// no
	0x7c,0x14,0x14,0x14,0x08,0x08,0x14,0x14,0x18,0x7c,	// pq
	0x7c,0x08,0x04,0x04,0x08,0x48,0x54,0x54,0x54,0x20,	// rs
	0x04,0x3f,0x44,0x40,0x20,0x3c,0x40,0x40,0x20,0x7c,	// tu
	0x1c,0x20,0x40,0x20,0x1c,0x3c,0x40,0x30,0x40,0x3c,	// vw
	0x44,0x28,0x10,0x28,0x44,0x0c,0x50,0x50,0x50,0x3c,	// xy
	0x44,0x64,0x54,0x4c,0x44				// z
    };
    for (i = 0; i < 5; i++)
    {
		dst[i] = font[((uint8_t)chr*5)+((uint8_t)i)];
	}
}

void font_getbitmap (char bitmap, unsigned char dst[8])
{
	int i;
	
        for (i = 0; i < 8; i++)
	  dst[i] = bitmaps[(uint8_t)bitmap][(uint8_t)i];
}

unsigned char font_getbitmappixel ( char bitmap, char x, char y)
{
	uint8_t tmp = bitmaps[(uint8_t)bitmap][(uint8_t)x];
	  return (tmp >> y) & 0x01;
}

en tous cas merci d' avance ....

bonsoir,

faut il que le cube soit multiplexé? le mien n'y est pas et il fait 7x7x7, que faudrait il modifier pour que je puisse adapter votre prog à mon cube?
merci pour vos réponses.