/*void setup() {
// put your setup code here, to run once:
Serial1.begin(115200);
Serial1.println("Hello, Raspberry Pi Pico!");
}
void loop() {
// put your main code here, to run repeatedly:
delay(1); // this speeds up the simulation
}
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Simulated LED pin (for the purpose of simulation)
#define LED_PIN 17
// Function to simulate blinking an LED a specified number of times
void blinkLED(int times) {
for (int i = 0; i < times; i++) {
// Simulate LED ON
printf("LED ON\n");
for (int delay = 0; delay < 1000000; delay++) {
// Simulate delay (no actual usleep function in simulation)
}
// Simulate LED OFF
printf("LED OFF\n");
// Simulate LED OFF (wait 500 milliseconds)
for (int delay = 0; delay < 1000000; delay++) {
// Simulate delay (no actual usleep function in simulation)
}
}
}
int main() {
srand(time(0)); // Seed random number generator
// Simulate blinking for each minute
for (int minute = 1; minute <= 3; minute++) {
int blinkCount = minute * 10; // Calculate blink count for the current minute
printf("Minute %d: Blinking LED %d times\n", minute, blinkCount);
blinkLED(blinkCount); // Simulate blinking LED
// Simulate 60 seconds delay (1 minute)
printf("Waiting for 60 seconds...\n");
for (int delay = 0; delay < 60000000; delay++) {
// Simulate delay (no actual usleep function in simulation)
}
}
return 0;
}