Keil Logo

Push Button

The following Signal Function may be used to toggle an I/O pin similar to a connected switch.

//
// Toggle I/O Pin
//
signal void Toggle_IO_Pin (unsigned char digit)  {
  PORT2 = (PORT2 ^ 0x01);
}

You may define a Toolbox button that allows to access this function quickly with the following DEFINE command.

DEFINE BUTTON "Toggle P2.0", "Toggle_IO_Pin()"
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.