How do I define the push-button on the startKIT?
The documentation isn't clear on this neither are the demos that use the push-button.
Do I need to define the 32bit port first and then define the button?
#define out port p32 = XS1_PORT_32A;
#define in port butt1 = XS1_PORT_32A0;
How to declare Push-button on startKIT? Topic is solved
-
- Member++
- Posts: 17
- Joined: Mon Dec 16, 2013 11:44 pm
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
You can declare the port using the following syntax:
port p_32A = XS1_PORT_32A;
to read the data of the button,
p_32:> data;
data=data&0x01;
if(data)
{
printstrln("Button Pressed");
}
port p_32A = XS1_PORT_32A;
to read the data of the button,
p_32:> data;
data=data&0x01;
if(data)
{
printstrln("Button Pressed");
}