To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3397
3396  |  3398
Subject: 
sys_time not working
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 5 Aug 2003 17:46:32 GMT
Viewed: 
3071 times
  
Hi i install successfully brickOS-0.2.6.10 under Win2000 without any
problems and ran successfully "helloworld.lx"

I created one first elementary small program using the sys_time function.
The problem is that it doesn't
compile correctly. The message is

Straight.c: In function `main':
Straight.c:25: `sys_time' undeclared (first use in this function)
Straight.c:25: (Each undeclared identifier is reported only once
Straight.c:25: for each function it appears in.)

The code is the following having ommited some useless parts for saving
space:

#include <conio.h>
#include <unistd.h>
#include <time.h>
#include <tm.h>
#include <dsensor.h>
#include <dmotor.h>

long int t1,t2,t;

int main(int argc, char *argv[]) {
...........
........

t1=sys_time;
t=0;
t2=0;

  while(t<5000){
........
  }
t2=sys_time;
t=t2-t1;
}

motor_a_dir(0);
motor_c_dir(0);

  return 1;
}



Message has 1 Reply:
  Re: sys_time not working
 
(...) Use get_system_up_time() instead (as modified below). #include <conio.h> #include <unistd.h> #include <time.h> #include <tm.h> #include <dsensor.h> #include <dmotor.h> long int t1,t2,t; int main(int argc, char *argv[]) { ......... ........ (...) (21 years ago, 5-Aug-03, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR