最近在搞psoc,那是真是个一头雾水啊!幸好最近有点进展啊!谢了个流水灯啊!哈哈。。。还有zitbeer等着我呢啊!呜呜。。。。
#include <device.h>
#define MS_DELAY 167u /* For delay, about 167ms */
void main(void)
{
uint8 ledState = 0x00; /* Initially set LED to off */
Clock_1_Enable(); /* Start the clock */
PWM_1_Start(); /* Enable PWM */
/* Following loop does software blinking of LED connected to P1.7 */
while (1)
{
CyDelay(MS_DELAY);
ledState = 0x01u;
LED2_Write(ledState);
CyDelay(1000u);
ledState = 0x00u;
LED2_Write(ledState);
CyDelay(MS_DELAY);
ledState = 0x01u;
LED3_Write(ledState);
CyDelay(1000u);
ledState = 0x00u;
LED3_Write(ledState);
CyDelay(MS_DELAY);
ledState = 0x01u;
LED4_Write(ledState);
CyDelay(1000u);
ledState = 0x00u;
LED4_Write(ledState);
CyDelay(MS_DELAY);
ledState = 0x01u;
LED5_Write(ledState);
CyDelay(1000u);
ledState = 0x00u;
LED5_Write(ledState);
}
} |