#include "stdafx.h" #include "User_Api.h" #include "PET_Type.h" #include "time.h" void delay(int sec) { int ms = 1000 * sec; clock_t start_time = clock(); while (clock() < start_time + ms); } int main() { int i; // init portwell API PET_API_Init(); // set GPIO 1 and 2 to outputs PET_GPIO_SetPinDirection (1, 1, 0); PET_GPIO_SetPinDirection (1, 2, 0); // blink! for (i = 1; i < 100; i++) { PET_GPIO_WritePin(1, 1, 1); PET_GPIO_WritePin(1, 2, 0); delay(75); PET_GPIO_WritePin(1, 1, 0); PET_GPIO_WritePin(1, 2, 1); delay(75); } // turn both LEDs off PET_GPIO_WritePin(1, 1, 0); PET_GPIO_WritePin(1, 2, 0); // close portwell API PET_API_Uninit (); }