Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

6. What questions would you suggest should be included?

Answered: 1 week ago

Question

5. Who should facilitate the focus group?

Answered: 1 week ago