source: Documentation/Tutorials/XPS_Intro/code/UserIO_Demo_v2.c

Last change on this file was 1445, checked in by sgupta, 14 years ago

tutorial source file

File size: 816 bytes
Line 
1#include "warp_v4_userio.h"
2#include "xparameters.h"
3
4int main(void)
5{
6    unsigned char ledDisp = 0;
7   
8    // Set the hex displays to number mode (see FPGA Board v2.2 User Guide)
9    WarpV4_UserIO_NumberMode_All(XPAR_WARP_V4_USERIO_ALL_BASEADDR);
10
11    while(1)
12    {
13        xil_printf("Displaying: %x\r\n", ledDisp);
14
15        // Show the number on the three hex displays and on the LEDs
16        WarpV4_UserIO_WriteNumber_LeftHex(XPAR_WARP_V4_USERIO_ALL_BASEADDR, ledDisp, 0);
17        WarpV4_UserIO_WriteNumber_MiddleHex(XPAR_WARP_V4_USERIO_ALL_BASEADDR, ledDisp, 0);
18        WarpV4_UserIO_WriteNumber_RightHex(XPAR_WARP_V4_USERIO_ALL_BASEADDR, ledDisp, 0);
19        WarpV4_UserIO_Leds(XPAR_WARP_V4_USERIO_ALL_BASEADDR, ledDisp);
20
21        usleep(600000);
22
23        //Cycle the displays through [0x0,0xF]
24        if(ledDisp == 15)
25            ledDisp = 0;
26        else
27            ledDisp++;
28    }
29   
30    return 0;
31
32}
Note: See TracBrowser for help on using the repository browser.