Go Down

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

prit18

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]

#include<stdio.h>
#include<time.h>
#include<stdlib.h>


     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;

     while((time(NULL)-MWANZO)<RUNNING_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.");
                    }
                    printf("\n\n");
            } else{
            timer = time(NULL) - start;
            }
         } while(timer != DELAY_TIME);
     }


     }

}


johnwasser

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: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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!

Arduino
via Egeo 16
Torino, 10131
Italy