Content originally posted in LPCWare by kalevikrant on Sat Feb 08 21:03:32 MST 2014
Hi Larry,
I have modified the blinky program and it works fine for out put section. But for input it's giving error.
Need some ideas how to go around it. The above program didnt work at all. Please find the modified Program
/* Set port p0.13 to output */
GPIOSetDir( 0, 13, 1 );
/* Set port p0.6 to input */
GPIOSetDir( 0, 6, 0 );
/* Set port p0.7 to input */
GPIOSetDir( 0, 7, 0 );
//init_mrt(0x8000);
while (1) /* Loop forever */
{
/* I/O configuration and LED setting pending. */
if ( GPIOSetBitValue( 0, 6, 0 ) == 0) " GIVING ERROR"
{
GPIOSetBitValue( 0, 13, 1 );
}
if (GPIOSetBitValue( 0, 6, 1 )== 1 )
{
GPIOSetBitValue( 0, 13, 0 );
}