I've made several complex VBA projects and even MS Dos batchfiles (don't ask me why)
But.. this can be handy in FC too.
Just ask the AI engine to generate code that does something specific and with a click of the mouse: there it is..
How will FC deal with this new "technology"?
I generated this code that calculates the day of the year:
Code: Select all
#include <stdio.h>
// Functie voor het bepalen of het jaar een schrikkeljaar is
int isLeapYear(int year) {
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0) {
return 1; // Schrikkeljaar
}
return 0; // Geen schrikkeljaar
}
return 1; // Schrikkeljaar
}
return 0; // Geen schrikkeljaar
}
// Functie voor het berekenen van de dag van het jaar
int getDayOfYear(int day, int month, int year) {
int daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int dayOfYear = day;
for (int i = 0; i < month - 1; ++i) {
dayOfYear += daysInMonth[i];
}
if (month > 2 && isLeapYear(year)) {
++dayOfYear; // Voeg 1 dag toe aan februari in een schrikkeljaar
}
return dayOfYear;
}
int main() {
// Datumwaarden
int day = 12;
int month = 7;
int year = 2023;
// Bereken de dag van het jaar
int dayOfYear = getDayOfYear(day, month, year);
// Uitvoer
printf("Dag van het jaar: %d\n", dayOfYear);
return 0;
}
Let's open the discussion in this topic.
At this moment I don't have the access to program an MCU (to test the code) but will be glad to read what other people think about FC and AI.