~dcow90/myro-c++/extern-c

« back to all changes in this revision

Viewing changes to src/Myro.cpp

  • Committer: John Hoare
  • Date: 2011-03-29 20:20:53 UTC
  • Revision ID: john@johnami.com-20110329202053-3o4liyjbocsqdxff
Added some myro functions that are in the book but not in the library, currentTime() and randomNumber()

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    return true;
43
43
}
44
44
 
 
45
double currentTime(){
 
46
    time_t theTime = time(NULL);
 
47
    return (double)theTime;
 
48
}
 
49
 
 
50
double randomNumber(){
 
51
    return (double)rand()/RAND_MAX;
 
52
}
 
53
 
45
54
void connect(std::string port){
46
55
        int status = robot.connect(port); 
47
56
        if(status < 0) {