Not applicable
Jan 14, 2015
05:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2015
05:09 AM
I have a KIT_XMC45_RELAX_V1,but I don't konw how to use IO003 and IO004, especial the Input usage.
I want to leran the face factory program preloaded on XCM4500 Relax Kit, it realized the function that button1 control led1 and button2 control led2.
I want to leran the face factory program preloaded on XCM4500 Relax Kit, it realized the function that button1 control led1 and button2 control led2.
- Tags:
- IFX
3 Replies
Not applicable
Jan 14, 2015
06:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2015
06:05 PM
Hi,
I don't have the preloaded program but it is quite simple to control the function of the LEDs and Buttons.
All you need is IO004 app.
For LEDs, set it to output and for Buttons, just leave it default which is input.
Then uses the API, IO004_ReadPin to read the value from Button then toggle/set/reset the LEDs.
Example:
I don't have the preloaded program but it is quite simple to control the function of the LEDs and Buttons.
All you need is IO004 app.
For LEDs, set it to output and for Buttons, just leave it default which is input.
Then uses the API, IO004_ReadPin to read the value from Button then toggle/set/reset the LEDs.
Example:
bool PinInput = 1;
PinInput = IO004_ReadPin(IO004_Handle2); // Read BUTTON1
if(PinInput == 0)
{
IO004_TogglePin(IO004_Handle0); // Toggle LED1
PinInput = 1;
}
PinInput = IO004_ReadPin(IO004_Handle3); // Read BUTTON2
if(PinInput == 0)
{
IO004_TogglePin(IO004_Handle1); // Toggle LED2
PinInput = 1;
}
Not applicable
Feb 02, 2015
07:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 02, 2015
07:47 PM
I had check your code,it need to eliminate the shaking from button.
Not applicable
Feb 02, 2015
10:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 02, 2015
10:57 PM
Hi,
Yes, this is just a simple code to show how to control the LED and button.
In order for the button work properly, you need to have the debounce function implemented.
Yes, this is just a simple code to show how to control the LED and button.
In order for the button work properly, you need to have the debounce function implemented.