Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming in C: How to code this: Task 4 - Using GhGetRandom and GhDelay Our project this term is to develop software to run the
Programming in C:
How to code this:
Task 4 - Using GhGetRandom and GhDelay Our project this term is to develop software to run the environmental controls for a greenhouse. Most real-time programs start with an initialization section which is followed by and endless loop of repeated tasks that use random numbers and finally a delay at the end of this loop. When using random number generation you must initialize the random number generator with a random number before the rando) function is first used. This is done by calling another standard library function called stand. A standard techniqueis to pass it a number representing the current time, which always varies. Start by checking fro the symbolic constant called GHUPDATE with a value of 2000 in ghch: #define GHUPDATE 2000 Then write the function GhController Init within lab03.c. 1. This function calls the stand function with the argument (unsigned) time(NULL). srand((unsigned) time(NULL)); 2. and also calls GhDisplay Header 3. and GhGetSerial: fprintf(stdout, "Unit: %LX ",GhGeSerial(); Task 4 - Using GhGetRandom and GhDelay Our project this term is to develop software to run the environmental controls for a greenhouse. Most real-time programs start with an initialization section which is followed by and endless loop of repeated tasks that use random numbers and finally a delay at the end of this loop. When using random number generation you must initialize the random number generator with a random number before the rando) function is first used. This is done by calling another standard library function called stand. A standard techniqueis to pass it a number representing the current time, which always varies. Start by checking fro the symbolic constant called GHUPDATE with a value of 2000 in ghch: #define GHUPDATE 2000 Then write the function GhController Init within lab03.c. 1. This function calls the stand function with the argument (unsigned) time(NULL). srand((unsigned) time(NULL)); 2. and also calls GhDisplay Header 3. and GhGetSerial: fprintf(stdout, "Unit: %LX ",GhGeSerial()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started