const uint32_t Table[6][8][10] = {{ { 0x00400010, ....
const uint32_t Table[2][8][10] = {{ { 0x00400010, .....
It is no sense to put constant arrays inside voids. They anyway will requere a flash memory.
#include "main.h"
#include "stm32l4xx_hal.h"
#include "gpio.h"
void SystemClock_Config(void);
void Error_Handler(void);
int main(void)
{
const int Bitmap[3][8][10] = {{{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0}},
{{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0}},
{{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0},{1,2,3,4,5,6,7,8,9,0}}};
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
while (1)
{
HAL_GPIO_TogglePin(LD_G_GPIO_Port,LD_G_Pin);
HAL_GPIO_WritePin(LD_R_GPIO_Port, LD_R_Pin, GPIO_PIN_RESET);
HAL_Delay(500);
}
}
This is the whole code, i have used StmCube, Hal functions are made by it ...
#include "main.h"
#include "stm32l4xx_hal.h"
#include "lcd.h"
#include "gpio.h"
void SystemClock_Config(void);
void Error_Handler(void);
const uint32_t Table[6][8][10] = {{ {0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{ {0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{ {0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{ {0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{ {0x00400010, 0x00400000, 0x00F0001F, 0x00F0000F, 0x00F0000F, 0x0080000F, 0x0080001F, 0x00400000, 0x00F0001F, 0x00F0000F},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00F00018, 0x00800000, 0x00400010, 0x00F00010, 0x00800008, 0x00F00018, 0x00F00018, 0x00F00000, 0x00F00018, 0x00F00018},
{0x0000fff0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fff0, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}}};
int main(void)
{
uint32_t i,j;
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_LCD_Init();
while (1)
{
HAL_GPIO_WritePin(LD_R_GPIO_Port, LD_R_Pin, GPIO_PIN_SET);
HAL_LCD_Init(&hlcd);
HAL_LCD_MspInit(&hlcd);
HAL_LCD_Clear(&hlcd);
j = 0;
while( 1 )
{
for(i=0 ; i<8 ; i++){
HAL_LCD_Write(&hlcd, i, Table[5][i][j], Table[5][i][j]);
}
HAL_LCD_UpdateDisplayRequest(&hlcd);
HAL_Delay(1000);
j++;
if ( j == 10 ) j=0;
}
HAL_GPIO_WritePin(LD_R_GPIO_Port, LD_R_Pin, GPIO_PIN_RESET);
while(1);
}
}
code const uint32_t Array[10][10][10] = { {...}, {...}, {...}};
const code uint32_t Array[10][10][10] = { {...}, {...}, {...}};
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?