Re:GPIO
And I don't think you can write 0 to a pin and have it go low, either, can you?
Actually, you can - since I was sending out a "0", I was actually sending out a "00000000" and the pin I was addressing went low as I expected.
GPIOPinWrite(GPIO_PORTA_BASE,0x20,0); //This works.
But when I tried to set the bit this way:
GPIOPinWrite(GPIO_PORTA_BASE,0x20,1); //Wrong.
I got nothing, since I assumed it was just a boolean parameter.
Until I figured out I had to do this:
GPIOPinWrite(GPIO_PORTA_BASE,0x20,0x20); or GPIOPinWrite(GPIO_PORTA_BASE,0xff,0x20);
The latter also sets the rest of the port bits low however.
Capper
login or register to reply
|