Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Problem with reading an input on pin X

Problem with reading an input on pin X

2006-03-15 by teddyroskvist

Would You please show me how to read if an input from a switch.

I have been trying on many ways, but it dosen't work proberly - I get 
strange results.
Here is an example of one my tryes.

int main (void)  
{
	IO1DIR = 0xff000000;
	while(1) 
	{
		if ((IO1PIN & 0x00ffffff) >= 0x00000000)
			IO1SET = 0xff000000;
		else
			IO1CLR = 0xff000000;
	};
	return 0;
}

What is wrong?

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.