|
Hi Dana,
I ran through the truth table and as expected it works beautifully, the led illuminates according to the truth table in the program,
As mentioned before if i want the program to do as i described before, im thinking of having outputs and inputs connected like so.
Its not critical if only one led is used as an output,
Signal Output Input LED output
P0.4 P0.0 P1.0
P0.5 P0.1 P1.1 or P1.0 // maybe better if four leds are used for testing
P0.6 P0.2 P1.2 or P1.0 // same reason as above
P0.7 P0.3 P1.3 or P1.0 //as above
im thinking of having the program step through with the possibility of a very small delay between input checks
so basically the program would be like this:
// enable port 0.4
// check port 0.0
// IF port 0.0 high as it should be led (p1.0) off
// else led (p1.0) on
//disable Port 0.4
//Small delay, repeat same code for other three inputs
Im thinking of just using the code Lleung kindly provided and just modifying the bits to be masked if thats how its done?
so it would be like;
port_1_data_shade &= 0xf0;
port_1_data_shade |= (ledrive[prt0dr & 0x0E]); // 0xOE for port 0.0 ?
any advice would be greatly appreciated,
thanks guys
|