EasyManua.ls Logo

Portwell RUBY-D716VG2AR - Page 45

Portwell RUBY-D716VG2AR
80 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
System Installation
RUBY-D716VG2AR User’s Manual 3-27
printf("PIN 1,2,3,4 is output ; PIN 5,6,7,8 is input\n");
printf("GPIO 1 ---> GPIO 5\n");
printf("GPIO 2 ---> GPIO 6\n");
printf("GPIO 3 ---> GPIO 7\n");
printf("GPIO 4 ---> GPIO 8\n");
printf("GND xxxx VCC <===PWR/GND pins, DO NOT short them!\n");
printf("Test Begins...\n");
gpio_setdirection (0xF0);
gpio_write (0x00);
gpio_readpin (5, &d2);
delay (2);
if (d2 == 0)
printf ("GPIO 1->GPIO 5 test PASS !!! (pull low)\n");
else
printf ("GPIO 1->GPIO 5 test FAIL !!! (pull high) \n");
gpio_readpin (6, &d2);
delay (2);
if (d2 == 0)
printf ("GPIO 2->GPIO 6 test PASS !!! (pull low)\n");
else
printf ("GPIO 2->GPIO 6 test FAIL !!! (pull high)\n");
gpio_readpin (7, &d2);
delay (2);
if (d2 == 0)
printf ("GPIO 3->GPIO 7 test PASS !!! (pull low)\n");
else
printf ("GPIO 3->GPIO 7 test FAIL !!! (pull high)\n");
gpio_readpin (8, &d2);
delay (2);
if (d2 == 0)
printf ("GPIO 4->GPIO 8 test PASS !!! (pull low)\n");
else
printf ("GPIO 4->GPIO 8 test FAIL !!! (pull high)\n");
return 0;
}

Related product manuals