How to declare Push-button on startKIT? Topic is solved

If you have a simple question and just want an answer.
marssystems
Member++
Posts: 17
Joined: Mon Dec 16, 2013 11:44 pm

How to declare Push-button on startKIT?

Post by marssystems »

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;

 



View Solution
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

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");

}