Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- gatedClock
- Date:
- 2013-09-06
- Revision:
- 1:cc6f7a7e1b38
- Parent:
- 0:07602282e53c
- Child:
- 2:b77c5ff37378
File content as of revision 1:cc6f7a7e1b38:
void delay(void);
#define FIO2DIR0 (*(volatile unsigned char *) (0x2009C040))
#define FIO2PIN0 (*(volatile unsigned char *) (0x2009C054))
//==============================================//==============================
int main()
{
FIO2DIR0=0xFF; // set port 2. lowest byte to output.
while (1)
{
FIO2PINO |= 0x01; // OR bit 0 with 1 to set pin high.
delay();
FIO2PIN) &= ~0x01; // AND bit 0 with 0 to set pin low.
delay();
} // while (1)
} // main.
/*----------------------------------------------//----------------------------*/
void delay(void)
{
int j; // loop variable j.
for (j = 0; j < 1000000; j++)
{
j++;
j--;
}
}
/*----------------------------------------------//----------------------------*/
/*----------------------------------------------//----------------------------*/