#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
//declaring the function
void printbin32(uint32_t valu);
void app_main() {
//initializing the unsigned integer ‘count’ to 0
uint32_t count = 0;
while (1) {
// calls the printbin32 function
printbin32(count);
//counts up by one
count++;
vTaskDelay(500 / portTICK_PERIOD_MS); // Delay for 500 milliseconds
}
}
//defining the function
void printbin32(uint32_t valu) {
printf("The value of %lu in binary is: 0b", valu); // Use %lu for uint32_t
for (int i = 31;i >= 0;i--) {
printf("%lu", (valu >> i) & 1);
}
printf("\n");
}