Hi,
I want to use the processor expert BitIoLddin order to enable and disable output and input pins.
I read this tutorial: Tutorial: Bits and Pins with Kinetis and the FRDM-KL25Z Board | MCU on Eclipse
I am currently able to turn the red led on and off using the BitIO component (which have the BitIOLdd).
My code is doing the following:
(1) Turn on Red led. (Bit1_SetVal();)
(2) Turn off Red Led. (Bit1_ClrVal();)
The problem is that after (2) runs and turn off the led it turns on again in the next line of code...
Thanks,
Avner
Solved! Go to Solution.
Hi Avner,
the LED is low active, so putting the pin LOW with ClrVal() will turn the LED on.
Check the schematics of your board :-).
Erich
Could you share your code? I would put it into an endless loop with some waiting method (you can get the Wait component from SourceForge: McuOnEclipse Releases on SourceForge), like this:
for(;;) {
RED_SetVal(RED_DeviceData);
WAIT1_Waitms(100); /* wait 100 ms */
RED_ClrVal(RED_DeviceData);
WAIT1_Waitms(100); /* wait 100 ms */
}
Erich
Hi Erich,
Sorry for the long delay in replying.
I tested what you suggested and this is working, turning the led on and off.
When I changed it to run only five times, it acted the same, but at the end it left the led turned on.
This is how I define the BitIO:
and my main is:
Thanks,
Avner
Hi Avner,
the LED is low active, so putting the pin LOW with ClrVal() will turn the LED on.
Check the schematics of your board :-).
Erich
Thanks