WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>

Chapter 04

Developing a Utility Library for the Propeller PCB

Page 6

Questions

The following series of questions is hypothetical.
The aim is to increase imagination.
The questions assume that the propeller is moving at a constant speed, practically it might not.

onSeq
Q11 Suppose if the Propeller is rotating at a constant speed of RPM = 1200
It will make 20 number of turns in a second (1200/60 = 20)
and to move one degree it will take 137.888889 micro seconds
Assume that time taken to execute the instructions is negligible.
What pattern the following code displays/renders:

float D = 137.888889;

unsigned int onSequence = 0x5555; // 0101 0101 0101 0101 Even LEDs are ON
unsigned char color =0x01;        // Color = RED

int main()
{
	while(1)
	{
		switch_LEDs(onSequence, color); 
	}
}


Imagine: What do you see ? Scroll below to check your answer
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. There is no relation to RPM and float D = 137.888889; the following pattern will be displayed:

Answer



WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>