If itoa function gives you an error, use sprintf instead of itoa as shown below sprintf(snum,"%d", x); You need to include stdio.h for this function as shown below /* USER CODE BEGIN Includes */ #include "stdio.h" /* USER CODE END Includes */
Hello sir I have never missed any of your video, your content is amazing I have tried almost all projects, I would recommend you to do a bluepill project where MCU would send a live time data to http server or firebase using GSM(GPRS).
hi, i don't know how to use HD44780_CreateSpecialChar, HD44780_PrintSpecialChar, HD44780_LoadCustomCharacter. Can you show me a example to use it ? Please
Hi Sahil, It is very simple. Follow this video for LCD Displayand video ruclips.net/video/BK-bL9cMOSM/видео.html for DHT11. For I2C speed ***DO NOT CHANGE*** Fast Mode (LCD works Standard mode 100000Hz) I have prepared the code for DHT11 with LCD1602 below /* USER CODE BEGIN Includes */ #include "liquidcrystal_i2c.h" #include "stdio.h" /* USER CODE END Includes */ /* USER CODE BEGIN 0 */ #define DHT11_PORT GPIOB #define DHT11_PIN GPIO_PIN_9 uint8_t RHI, RHD, TCI, TCD, SUM; uint32_t pMillis, cMillis; float tCelsius = 0; float tFahrenheit = 0; float RH = 0; uint8_t TFI = 0; uint8_t TFD = 0; char strCopy[15]; void microDelay (uint16_t delay) { __HAL_TIM_SET_COUNTER(&htim1, 0); while (__HAL_TIM_GET_COUNTER(&htim1) < delay); } uint8_t DHT11_Start (void) { uint8_t Response = 0; GPIO_InitTypeDef GPIO_InitStructPrivate = {0}; GPIO_InitStructPrivate.Pin = DHT11_PIN; GPIO_InitStructPrivate.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructPrivate.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStructPrivate.Pull = GPIO_NOPULL; HAL_GPIO_Init(DHT11_PORT, &GPIO_InitStructPrivate); // set the pin as output HAL_GPIO_WritePin (DHT11_PORT, DHT11_PIN, 0); // pull the pin low HAL_Delay(20); // wait for 20ms HAL_GPIO_WritePin (DHT11_PORT, DHT11_PIN, 1); // pull the pin high microDelay (30); // wait for 30us GPIO_InitStructPrivate.Mode = GPIO_MODE_INPUT; GPIO_InitStructPrivate.Pull = GPIO_PULLUP; HAL_GPIO_Init(DHT11_PORT, &GPIO_InitStructPrivate); // set the pin as input microDelay (40); if (!(HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN))) { microDelay (80); if ((HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN))) Response = 1; } pMillis = HAL_GetTick(); cMillis = HAL_GetTick(); while ((HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN)) && pMillis + 2 > cMillis) { cMillis = HAL_GetTick(); } return Response; } uint8_t DHT11_Read (void) { uint8_t a,b; for (a=0;a cMillis) { // wait for the pin to go high cMillis = HAL_GetTick(); } microDelay (40); // wait for 40 us if (!(HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN))) // if the pin is low b&= ~(1
Hello. I am trying to connect an Geeek Pi LCD to NUCLEO-L053R8 using IC2 interface. I was wondering if the I2C address for this LCD will be the same as the LCD used in the example. I would really appreciate if we can connect, i am working on my senior design project.
i am using stm32f030f4p6 and I got problem in liquid_crystal_i2c.c in the syntaxe DWT..... (I changed the source to 0xx...instead of 4xx which means the problem is not here) so what is the problem
I tried it on arduino and it works, but when I try it the way you show, the first 8 digits are fine but the last 8 digits are rectangular. Is there any solution for this?
Hi, other than the Ground and Vcc, the other 2 pins does it matter which pin it is connected to? Must it be a ADC pin or just normal GPIO pins will do? :)
Open the C file and C header file in any notepad or wordpad , and in keil uv , in the application folder create the .c and .h file and name them accordingly and paste the content in it , it will resolve your issue
Sir, I have tried to follow step by step but when compile find an error : make: *** [Core/Src/subdir.mk:37: Core/Src/liquidcrystal_i2c.o] Error 1 How to fix it sir ?
finally i found my problem, the potentiometer on the driver 8574 was incorrectly adjusted from the factory. Now it works very well, thx :) Can i ask you to make a same vdo with a optocoupler sensor IR RPM, thx in advance ;)
I made a video on STM32CubeIDE Optocoupler sensor module as RPM meter (Tachometer) with STM32F103C8T6. Link is below ruclips.net/video/4MUIaXnK8yw/видео.html
../Core/Inc/liquidcrystal_i2c.h(61): warning: #1295-D: Deprecated declaration HD44780_Clear - give arg types i have this error i don't know what to do :( but your video are very useful thank you so much sir
if you change void HD44780_Clear(); in the library to void HD44780_Clear(void); The compiler may not throw this error Add (void) inside the brackets and see
@@NizarMohideen it worked! thank you sir and it only have the error ..\Core\Src\liquidcrystal_i2c.c(32): error: #253: expected a "," thank you so much for helping me sir
If itoa function gives you an error, use sprintf instead of itoa as shown below
sprintf(snum,"%d", x);
You need to include stdio.h for this function as shown below
/* USER CODE BEGIN Includes */
#include "stdio.h"
/* USER CODE END Includes */
I'veseen many videos and tutorials about 1602 Display, but this is , by far, the best of them.
Thank you. Thanks to the library creator JIHOON LEE (eziya)
Hello sir I have never missed any of your video, your content is amazing I have tried almost all projects, I would recommend you to do a bluepill project where MCU would send a live time data to http server or firebase using GSM(GPRS).
Great suggestion!
@@NizarMohideen I need your mail ID so that I could contact you, I'm doing a project in the http protocol please let me know how do i contact you sir.
nizarmohideen@hotmail.com
I did it in the exact same way but nothing displayed lol, what could be wrong pl?
How did you solve your problem?can you help me
@@AbuBokorSiddik-i don't remember exactly, i remember just setup incubemx then told chatgpt to write the code then it worded
hi, i don't know how to use HD44780_CreateSpecialChar, HD44780_PrintSpecialChar, HD44780_LoadCustomCharacter. Can you show me a example to use it ? Please
Thank you. Excellent tutorials.
You are welcome!
Can you make a video on interfacing dht11 temperature and humidity sensor using STM32 and it's output showing on lcd 🙏🙏
Hi Sahil,
It is very simple.
Follow this video for LCD Displayand video ruclips.net/video/BK-bL9cMOSM/видео.html for DHT11.
For I2C speed ***DO NOT CHANGE*** Fast Mode (LCD works Standard mode 100000Hz)
I have prepared the code for DHT11 with LCD1602 below
/* USER CODE BEGIN Includes */
#include "liquidcrystal_i2c.h"
#include "stdio.h"
/* USER CODE END Includes */
/* USER CODE BEGIN 0 */
#define DHT11_PORT GPIOB
#define DHT11_PIN GPIO_PIN_9
uint8_t RHI, RHD, TCI, TCD, SUM;
uint32_t pMillis, cMillis;
float tCelsius = 0;
float tFahrenheit = 0;
float RH = 0;
uint8_t TFI = 0;
uint8_t TFD = 0;
char strCopy[15];
void microDelay (uint16_t delay)
{
__HAL_TIM_SET_COUNTER(&htim1, 0);
while (__HAL_TIM_GET_COUNTER(&htim1) < delay);
}
uint8_t DHT11_Start (void)
{
uint8_t Response = 0;
GPIO_InitTypeDef GPIO_InitStructPrivate = {0};
GPIO_InitStructPrivate.Pin = DHT11_PIN;
GPIO_InitStructPrivate.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructPrivate.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStructPrivate.Pull = GPIO_NOPULL;
HAL_GPIO_Init(DHT11_PORT, &GPIO_InitStructPrivate); // set the pin as output
HAL_GPIO_WritePin (DHT11_PORT, DHT11_PIN, 0); // pull the pin low
HAL_Delay(20); // wait for 20ms
HAL_GPIO_WritePin (DHT11_PORT, DHT11_PIN, 1); // pull the pin high
microDelay (30); // wait for 30us
GPIO_InitStructPrivate.Mode = GPIO_MODE_INPUT;
GPIO_InitStructPrivate.Pull = GPIO_PULLUP;
HAL_GPIO_Init(DHT11_PORT, &GPIO_InitStructPrivate); // set the pin as input
microDelay (40);
if (!(HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN)))
{
microDelay (80);
if ((HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN))) Response = 1;
}
pMillis = HAL_GetTick();
cMillis = HAL_GetTick();
while ((HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN)) && pMillis + 2 > cMillis)
{
cMillis = HAL_GetTick();
}
return Response;
}
uint8_t DHT11_Read (void)
{
uint8_t a,b;
for (a=0;a cMillis)
{ // wait for the pin to go high
cMillis = HAL_GetTick();
}
microDelay (40); // wait for 40 us
if (!(HAL_GPIO_ReadPin (DHT11_PORT, DHT11_PIN))) // if the pin is low
b&= ~(1
@@NizarMohideen hello sir any library have to include for this project
Inside Core/Inc Folder
github.com/eziya/STM32_HAL_I2C_HD44780/blob/master/Src/liquidcrystal_i2c.h
Inside Core/Src Folder
github.com/eziya/STM32_HAL_I2C_HD44780/blob/master/Src/liquidcrystal_i2c.c
Error shows up in line no 73,74,165 on main.c saying that htim1 undeclared
What should i do now? 🙏🏻
Hello. I am trying to connect an Geeek Pi LCD to NUCLEO-L053R8 using IC2 interface. I was wondering if the I2C address for this LCD will be the same as the LCD used in the example. I would really appreciate if we can connect, i am working on my senior design project.
i am using stm32f030f4p6 and I got problem in liquid_crystal_i2c.c in the syntaxe DWT..... (I changed the source to 0xx...instead of 4xx which means the problem is not here) so what is the problem
Thanks for your guide line. Please guide me how can I modified code for 20x4 lcd
Could you modify it?
I tried it on arduino and it works, but when I try it the way you show, the first 8 digits are fine but the last 8 digits are rectangular. Is there any solution for this?
solved it, my voltage regulator was broken and I was feeding the lcd with 12 volts
i hope we can drag and drop the .C and .H Files to SRC and Include folder respectively ?
You can
Hi, other than the Ground and Vcc, the other 2 pins does it matter which pin it is connected to? Must it be a ADC pin or just normal GPIO pins will do? :)
We need to use I2C pins only.
If you use I2C1 (SCL - pin PB6 and SDA - pin PB7)
If you use I2C2 (SCL - pin PB10 and SDA - pin PB11)
I have a problem that LCD is not displaying. first line of display is on and that's it , do someone had same problem?
How did you solve your problem?
Hello, I am doing a project on STM32 with ADLX345 and LCD display in I2C. can you please help me
Why does it still give an error even though I've followed it from start to finish?
What is the error message.
Great...
Sir I am using Keil and CubeMX. For me, the folder structure doesn't have Include folder. What to do?
Open the C file and C header file in any notepad or wordpad , and in keil uv , in the application folder create the .c and .h file and name them accordingly and paste the content in it , it will resolve your issue
Sir, I have tried to follow step by step but when compile find an error : make: *** [Core/Src/subdir.mk:37: Core/Src/liquidcrystal_i2c.o] Error 1
How to fix it sir ?
Put liquidcrystal_i2c.h file inside Core/Inc folder
Put liquidcrystal_i2c.c file inside Core/Src folder
Can print float data type?.
hello, i have nothing on the lcd, i have only the light switch on and switch off!!!
finally i found my problem, the potentiometer on the driver 8574 was incorrectly adjusted from the factory. Now it works very well, thx :) Can i ask you to make a same vdo with a optocoupler sensor IR RPM, thx in advance ;)
Thanks
I made a video on STM32CubeIDE Optocoupler sensor module as RPM meter (Tachometer) with STM32F103C8T6. Link is below
ruclips.net/video/4MUIaXnK8yw/видео.html
Very nice sir g
Plz send the the display module configuration
Thanks
What "display module configuration" you need. Please let me know
error: #253: expected a "," , why?
../Core/Inc/liquidcrystal_i2c.h(61): warning: #1295-D: Deprecated declaration HD44780_Clear - give arg types
i have this error i don't know what to do :( but your video are very useful thank you so much sir
if you change void HD44780_Clear(); in the library to void HD44780_Clear(void);
The compiler may not throw this error
Add (void) inside the brackets and see
@@NizarMohideen thank you so much sir i will try it 🥰
@@NizarMohideen it worked! thank you sir and it only have the error ..\Core\Src\liquidcrystal_i2c.c(32): error: #253: expected a ","
thank you so much for helping me sir
its not working
Make sure the LED jumper in back module is not missing