Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing things to the lcd #1

Open
mohdezzi7 opened this issue Sep 12, 2020 · 1 comment
Open

Printing things to the lcd #1

mohdezzi7 opened this issue Sep 12, 2020 · 1 comment

Comments

@mohdezzi7
Copy link

Hey nikola-v,

I am using your library or downloaded it from your github and it does not print when I try to use it in STM32cubeIDE. I am trying to print a simple line and box.

Have you come across this issue? If you have, could you let me know how to solve it?

I think I am using it correctly. I will send you sample code to demonstrate how I am using it (my main loop):

int main(void)
{
/* USER CODE BEGIN 1 /
u8g2_t u8g2;
/
USER CODE END 1 */

/* MCU Configuration--------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();

/* USER CODE BEGIN Init */
HAL_ACC_Init();
/* USER CODE END Init */

/* Configure the system clock */
SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_I2C1_Init();
MX_SPI1_Init();
MX_I2C3_Init();
/* USER CODE BEGIN 2 */
u8g2_Setup_st7920_p_128x64_1(&u8g2, U8G2_R0, u8x8_byte_3wire_sw_spi, u8g2_gpio_and_delay_stm32);
u8g2_InitDisplay(&u8g2); // send init sequence to the display, display is in sleep mode after this,
u8g2_SetPowerSave(&u8g2, 0); // wake up display

HAL_GPIO_WritePin(LCD_RESET_GPIO_Port, LCD_RESET_Pin, RESET);
HAL_Delay(100);
HAL_GPIO_WritePin(LCD_RESET_GPIO_Port, LCD_RESET_Pin, SET);
HAL_Delay(200);

HAL_Delay(1000);



/* USER CODE END 2 */

/* Infinite loop */
/* USER CODE BEGIN WHILE */
HAL_ACC_Init();

//int16_t val_accel[3];

while (1)
{
	/* USER CODE END WHILE */

	/* USER CODE BEGIN 3 */
	//u8g2_DrawLine(&u8g2, 50,50, 100, 100);
	u8g2_DrawBox(&u8g2, 100, 50, 50, 40);
	u8g2_SendBuffer(&u8g2);
	TEST_ACC_GetVal();



	//TEST_UART_Blinky();
}
/* USER CODE END 3 */

}

.

@blacktamilan
Copy link

i am having similar trouble as well. This might help you. olikraus/u8g2#840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants