#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <stdint.h>
// Function to print the binary equivalent of a 32-bit unsigned integer
void printbin32(uint32_t num) {
printf("The value of %lu in binary is: 0b", (unsigned long)num);
for (int i = 31; i >= 0; i--) {
printf("%lu", (num >> i) & 1);
if (i % 8 == 0 && i != 0) {
printf(" ");
}
}
printf("\n");
}
void app_main() {
uint32_t count = 0; // Initializing count to 0
while (1) {
printbin32(count); // Print binary representation of count
count++; // Increment count
vTaskDelay(1 / portTICK_PERIOD_MS); // Delay for 1 milliseconds
}
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1