Thursday, February 4, 2010

Program 110: Short Time III













Program 110: Short Time III

Program 109 has been fixed. Now the delay is closer to what we expect. Not exactly what we expect, but close. What's happening now?




1 /***********************************************
2 * bit_delay -- Delay one bit time for *
3 * serial output, *
4 * *
5 * Note: This function is highly system *
6 * dependent. If you change the *
7 * processor or clock it will go bad. *
8 ***********************************************/
9 void bit_delay(void)
10 {
11 int i; // Loop counter
12 volatile int result;// Result of the multiply
13
14 // Factors for multiplication
15 int factorl = 12;
16 int factor2 = 34;
17
18 // We know that 1863 multiplies
19 // delay the proper amount
20 for (i = 0; i < 1863; ++i)
21 {
22 result = factor1 * factor2;
23 }
24 }


(Next Hint 95. Answer 39.)




















No comments: