Go Down

Topic: IDE unable to compile the code :smiley-surprise: (Read 7105 times) previous topic - next topic


hey there! i have written a program C with code::block 12.11 .... and the problem is arduino IDE is unable to compile the code! please check this code out! HELP  :)  :)  :)
Code: [Select]


     const int DELAY_TIME = 1;
     const int RUNNING_TIME = 30;
int main() {

     long long int start = time(NULL);
     long long int MWANZO = time(NULL);
     int timer = DELAY_TIME;

     int K, L;
     for(K=1; K<=8; K++){
         do {
            if(timer == DELAY_TIME) {
                timer = 0;
                start = time (NULL);
                system ("cls");
                for(L=1; L<=8; L++){
                    if(L==K) printf("\t0");
                    else printf("\t.");
            } else{
            timer = time(NULL) - start;
         } while(timer != DELAY_TIME);




That is a C program with a main() function.  To make it into an Arduino sketch you should start by changing  "int main()" to "void setup()" and adding "void loop() {}" at the bottom.

Then you will have to deal with the functions time() and system() being undefined.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131