- 52 -
Copyright © 2011 by element14
User Manual
return -1;
}
if((f_led2 = open(LED_D4, O_RDWR)) < 0){
printf("error in open %s",LED_D4);
return -1;
}
for(i = 0; i < 100; i++) {
dat1 = (i & 0x1)? '1': '0';
dat2 = (i & 0x2)? '1': '0';
write(f_led1, &dat1, sizeof(dat1));
write(f_led2, &dat2, sizeof(dat2));
usleep(300000);
}
return 0;
}
Step 2: Cross-compilation
arm-none-linux-gnueabi-gcc led_app.c -o led_app
Step 3: Download and run
Now download the compiled code into the evaluation board through TF card, USB flash disk or
network, locate the the directory with the led_app file and enter the following commands and press
Enter, to run led_app in the background.
chmod a+x ./led_app
./led_app
Summary of Contents for SBC8018
Page 35: ...35 Copyright 2011 by element14 User Manual Figure 3 4 3 Select USB Gadget Support Figure 3 5...
Page 87: ...87 Copyright 2011 by element14 User Manual Figure Appendix 2 15 Click OK Figure Appendix 2 16...
Page 91: ...91 Copyright 2011 by element14 User Manual Figure Appendix 2 23 Figure Appendix 2 24...