Go Down

Topic: IDE unable to compile the code :smiley-surprise: (Read 6 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: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

shortcuts: alt+s submit/post or alt+p preview