max7219

Hello
I have a question I have a max7219 display
and I have for example its on

Write_Max7219 (1, 00011000);

I would like to add a 1 on each side in a loop in the fure and a measure

Write_Max7219 (1, 00111100);

and after adding 1 on the column below from the first

Write_Max7219 (1, 00111100);
Write_Max7219 (1, 00011000);

and that its approval as its forth

Write_Max7219 (1, 01111110);
Write_Max7219 (2, 00111100);
Write_Max7219 (3, 00011000);

thank you in advance

Have you attempted to write anything or any numbers to this display even just to test it ?
If so, post some working code so it is clear what libraries etc. you are using.

I hope you have figured out that “00111100” is not the same as “0b00111100”

and that its approval as its forth

In the immortal words of Pete Hogwallop, “That don’t make no sense!”

sorry, I was wrong my code

Write_Max7219(1, B00011000);

6v6gt:
Have you attempted to write anything or any numbers to this display even just to test it ?
If so, post some working code so it is clear what libraries etc. you are using.

yes everything else works
the display and that's what I put on it
and I don’t use libraries

I didn't understand what it really does and how it works

so it gives

Write_Max7219 (1, B00011000);

delay(X)

Write_Max7219 (1, B00111100);
Write_Max7219 (2, B00011000);

delay(X)

Write_Max7219 (1, B01111110);
Write_Max7219 (2, B00111100);
Write_Max7219 (3, B00011000);
delay(X)

Write_Max7219 (1, B11111111);
Write_Max7219 (2, B01111110);
Write_Max7219 (3, B00111100);
Write_Max7219 (4, B00011000);
delay(X)

Write_Max7219 (2, B11111111);
Write_Max7219 (3, B01111110);
Write_Max7219 (4, B00111100);
Write_Max7219 (2, B00011000);
delay(X)

.........

in less line
and in a for

ludocraft:
yes everything else works
the display and that's what I put on it
and I don’t use libraries

I didn't understand what it really does and how it works

Where is this function Write_Max7219(a,b) defined if you are not using any libraries ?
If you have not yet got any code to write (just anything) to the max7219, find an example and play with that first before starting to attempt to display a string representation of a binary number.
Post the entire sketch, not just a snippet of it.

6v6gt:
Where is this function Write_Max7219(a,b) defined if you are not using any libraries ?
If you have not yet got any code to write (just anything) to the max7219, find an example and play with that first before starting to attempt to display a string representation of a binary number.
Post the entire sketch, not just a snippet of it.

//configuration pin
#define Max7219_pinCLK	10
#define Max7219_pinCS	11
#define Max7219_pinDIN 	12

//annimation
#define chargement	0
#define normal		1
#define droite		2 
#define gauche		3
#define cligne		4
#define mort		5
#define revie		6
#define amoure		7
 
//variable
unsigned char choix  =4;
unsigned char select =0;
char f =0;
char m =1;

//fonction
void Init_MAX7219();
void Write_Max7219(unsigned char address, unsigned char dat);
void Write_Max7219_byte(unsigned char DATA);

void setup() {

	pinMode(Max7219_pinCLK, OUTPUT);	
	pinMode(Max7219_pinCS, OUTPUT);
	pinMode(Max7219_pinDIN, OUTPUT);
  delay(60);
  
	Init_MAX7219();
  delay(50);
}

void loop() {
   
  
	switch (choix){
	
		
		
		case 1 :{//normal
		
		
			Write_Max7219(1, 126) ;
			Write_Max7219(8, 126) ;
			
				for (int f =2; f <7; f++){
				Write_Max7219(f, 66);
				}
			
		delay(5);
			
			
			for (int f =3; f <7; f++){
			Write_Max7219(f, 90);
			}
			
			
		f=0; 
		delay(50);
			
			
		break ;
		}
		
		case 2 :{//droite


			for (f =3; f <7; f++){
				Write_Max7219(f, 78);
			}
			
		delay(500);


			Write_Max7219(1, 63);
			Write_Max7219(8, 63);
			Write_Max7219(2, 33);
			Write_Max7219(7, 33);
				
				for (f =3; f <7; f++){
					Write_Max7219(f, 39);
				}
		
		
		delay(500);
		
			for (f =3; f <7; f++){
				Write_Max7219(f, 45);
				}
			
			
		delay(500);
		
			for (f =3; f <7; f++){
				Write_Max7219(f, 57);
			}
		
		delay(500);
		
		
			choix=1;
			
			
		break ;}
		
		case 3 :{//gauche
		
		
			for (f =3; f <7; f++){ 
				Write_Max7219(f, 114);
			}


		delay(500);
		
		
			Write_Max7219(1, 252);
			Write_Max7219(8, 252);
			Write_Max7219(2, 132);
			Write_Max7219(7, 132);
			
				for (f =3; f <7; f++){
					Write_Max7219(f, 228);
				}
				
				
		delay(500);
		
		
			for (f =3; f <7; f++){
				Write_Max7219(f, 180);
			}
			
		
		delay(500);
		
		
			for (f =3; f <7; f++){
				Write_Max7219(f, 156);
			}
			
			
		delay(500);
		
		
			choix=1;
			
			
		break ;}
		
		case 4 :{//cligne

			if (f ==0){
				
				for (f =1; f <8; f++){
					Write_Max7219(f, 126);
				delay(150);
				
				}
			}

			
			Write_Max7219(7, 66);
			
				for (f =6; f >2; f--){
					Write_Max7219(f, 90);
				delay(150);	
				}
				
			Write_Max7219(7, 66);
				
			
			 choix =1;


		break ;}
		
		case 5 :{//mort
			
			
			if(select < 200){
			
			
				for (f = 1; f <= 8; f++ ){
			
			  
					int bit1 = 1 << (rand() & 7);
					int bit2 = 1 << (rand() & 7);
					int bit3 = 1 << (rand() & 7);
					int bit4 = 1 << (rand() & 7);
					
					Write_Max7219(f, bit1 ^ bit2 ^ bit3 ^ bit4 );
					select++;
					
				}
				delay(75);
			}
			
			else{ 
				
				
				delay(random(1000, 2000));
				
				Write_Max7219(4, B00011000);
				delay(100);
				
				Write_Max7219(3, B00011000);
				Write_Max7219(4, B00111100);
				Write_Max7219(5, B00011000);
				delay(100);
				
				Write_Max7219(2, B00011000);
				Write_Max7219(3, B00111100);
				Write_Max7219(4, B01111110);
				Write_Max7219(5, B00111100);
				Write_Max7219(6, B00011000);
				delay(100);
				
				Write_Max7219(2, B00111100);
				Write_Max7219(3, B01111110);
				Write_Max7219(4, B11111111);
				Write_Max7219(5, B01111110);
				Write_Max7219(6, B00111100);
				Write_Max7219(7, B00011000);
				delay(100);
				
				Write_Max7219(1, B00100100);
				Write_Max7219(2, B01111110);
				Write_Max7219(3, B11111111);
				Write_Max7219(6, B01111110);
				Write_Max7219(7, B00111100);
				Write_Max7219(8, B00011000);
				delay(100);
				
				Write_Max7219(1, B01100110);
				Write_Max7219(2, B11111111);
				Write_Max7219(3, B11111111);
				Write_Max7219(6, B01111110);
				Write_Max7219(7, B00111100);
				Write_Max7219(8, B00011000);
				delay(100);
				
			
					choix=1;
				
			}
			
		break ;}
		
		
	
	
	}

}



void Init_MAX7219(void)
{
  Write_Max7219(0x09, 0x00);       //decoding :BCD
  Write_Max7219(0x0a, 0x03);       //brightness
  Write_Max7219(0x0b, 0x07);       //scanlimit;8 LEDs
  Write_Max7219(0x0c, 0x01);       //power-down mode:0,normal mode:1
  Write_Max7219(0x0f, 0x00);       //test display:1;EOT,display:0
}

//Ecriture sur une rangee
void Write_Max7219(unsigned char address, unsigned char dat)
{
  digitalWrite(Max7219_pinCS, LOW);
  Write_Max7219_byte(address);           //address,code of LED
  Write_Max7219_byte(dat);               //data,figure on LED
  digitalWrite(Max7219_pinCS, HIGH);
}

// Ecriture sur un 8x8
void Write_Max7219_byte(unsigned char DATA)
{
  unsigned char i;
  digitalWrite(Max7219_pinCS, LOW);
  for (i = 8; i >= 1; i--)
  {
    digitalWrite(Max7219_pinCLK, LOW);
    digitalWrite(Max7219_pinDIN, DATA & 0x80); // Extracting a bit data
    DATA = DATA << 1;
    digitalWrite(Max7219_pinCLK, HIGH);
  }
}

case after if in the game else if

case after if in the game else if

Wuh?

TheMemberFormerlyKnownAsAWOL:
Wuh?

sorry my me and english its done 2 i help me google translation

OK. So it appears you have a single 8x8 led matrix module.
Something like this ?

6v6gt:
OK. So it appears you have a single 8x8 led matrix module.
Something like this ?

yes its just the chip and under the leds

OK. It looks we have some code from you and some idea of the display device.
It appears that you want to add a new choice (choix) with a value of, for example, 6 which displays a new pattern

.XXXXXX.
..XXXX..
...XX...
........
........
........
........
........

Perhaps this pattern is static, or perhaps it moves up, down, left right etc. and with some timing intervals.

Is that correct ?

6v6gt:
OK. It looks we have some code from you and some idea of the display device.
It appears that you want to add a new choice (choix) with a value of, for example, 6 which displays a new pattern

.XXXXXX.

..XXXX..
...XX...
........
........
........
........
........




Perhaps this pattern is static, or perhaps it moves up, down, left right etc. and with some timing intervals.

Is that correct ?

dans le temp sa fait sa

...XX...
........
........
........
........
........
........
........

delay

..XXXX..
...XX...
........
........
........
........
........
........

delay

.XXXXXX.
..XXXX..
...XX...
........
........
........
........
........


delay

XXXXXXXX
.XXXXXX.
..XXXX..
...XX...
........
........
........
........

delay

XXXXXXXX
XXXXXXXX
.XXXXXX.
..XXXX..
...XX...
........
........
........


delay

XXXXXXXX
XXXXXXXX
XXXXXXXX
.XXXXXX.
..XXXX..
...XX...
........
........

(X=1 and .=0)

in the meantime i found the answer on another server thanks for your help

const byte lesOctets[] = {
  0b00011000,
  0b00111100,
  0b01111110,
  0b11111111,
  0b11111111
};

const byte total = sizeof(lesOctets) / sizeof(lesOctets[0]);

void imprimeOctet(byte unOctet)
{
  for (char i = 7; i>=0; i--)
  Serial.write(bitRead(unOctet, i) == 0 ? '-' : 'X');
}

void setup() {
  Serial.begin(115200);
  for (uint8_t i = 0; i < total; i++) {
    for (uint8_t j = 0; j <= i; j++) {
      Serial.print(j + 1);
      Serial.write('\t');
      imprimeOctet(lesOctets[i-j]);
      Serial.println();
    }
    Serial.println(F("delay(X)\n"));
  }
}

void loop() {}