|
我试着控制1114的IO,却只有部分IO能变化,但我也没有做其它任何动作,只是初始化了IO!
#include <lpc11xx.h>
#include "gpio.h"
void GPIO_Configuration(void);
void Delay (uint32_t nCount);
int main(void)
{
GPIOInit();
GPIO_Configuration();
while(1)
{
GPIOSetValue(PORT0,0,HIGH);
GPIOSetValue(PORT0,1,HIGH);
GPIOSetValue(PORT0,2,HIGH);
GPIOSetValue(PORT0,4,HIGH);
GPIOSetValue(PORT0,5,HIGH);
GPIOSetValue(PORT0,6,HIGH);
GPIOSetValue(PORT0,8,HIGH);
GPIOSetValue(PORT0,9,HIGH);
GPIOSetValue(PORT0,10,HIGH);
GPIOSetValue(PORT0,11,HIGH);
GPIOSetValue(PORT1,0,HIGH);
GPIOSetValue(PORT1,1,HIGH);
GPIOSetValue(PORT1,2,HIGH);
GPIOSetValue(PORT1,3,HIGH);
GPIOSetValue(PORT1,6,HIGH);
GPIOSetValue(PORT1,7,HIGH);
Delay(0xfffff);
GPIOSetValue(PORT0,0,LOW);
GPIOSetValue(PORT0,1,LOW);
GPIOSetValue(PORT0,2,LOW);
GPIOSetValue(PORT0,4,LOW);
GPIOSetValue(PORT0,5,LOW);
GPIOSetValue(PORT0,6,LOW);
GPIOSetValue(PORT0,8,LOW);
GPIOSetValue(PORT0,9,LOW);
GPIOSetValue(PORT0,10,LOW);
GPIOSetValue(PORT0,11,LOW);
GPIOSetValue(PORT1,0,LOW);
GPIOSetValue(PORT1,1,LOW);
GPIOSetValue(PORT1,2,LOW);
GPIOSetValue(PORT1,3,LOW);
GPIOSetValue(PORT1,6,LOW);
GPIOSetValue(PORT1,7,LOW);
Delay(0xfffff);
}
}
/*******************************************************************************
* Function Name : Delay
* Description : Delay Time
* Input : - nCount: Delay Time
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
void Delay (uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
/*******************************************************************************
* Function Name : GPIO_Configuration
* Description : Configure GPIO Pin
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
void GPIO_Configuration(void)
{
GPIOSetDir(PORT0,0,OUT);
GPIOSetDir(PORT0,1,OUT);
GPIOSetDir(PORT0,2,OUT);
GPIOSetDir(PORT0,4,OUT);
GPIOSetDir(PORT0,5,OUT);
GPIOSetDir(PORT0,6,OUT);
GPIOSetDir(PORT0,8,OUT);
GPIOSetDir(PORT0,9,OUT);
GPIOSetDir(PORT0,10,OUT);
GPIOSetDir(PORT0,11,OUT);
GPIOSetDir(PORT1,0,OUT);
GPIOSetDir(PORT1,1,OUT);
GPIOSetDir(PORT1,2,OUT);
GPIOSetDir(PORT1,3,OUT);
GPIOSetDir(PORT1,6,OUT);
GPIOSetDir(PORT1,7,OUT);
}
把这个代码烧到1112就更不靠谱了,一个IO都没有动,本人初学,求大虾指路,十分感谢 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
你熬了10碗粥,别人一桶水倒进去,淘走90碗,剩下10碗给你,你看似没亏,其实你那10碗已经没有之前的裹腹了,人家的一桶水换90碗,继续卖。说白了,通货膨胀就是,你的钱是挣来的,他的钱是印来的,掺和在一起,你的钱就贬值了。
|