Embest AM3517 Specifications Page 61

  • Download
  • Add to my manuals
  • Print
  • Page
    / 98
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 60
Page | 55
4.7 Linux Application Development
This section will introduce how to conduct application development on the
SOC8200 hardware platform, including the formation of an SOC8200
software environment. Examples will be taken to show the general process
of the development of SOC8200 applications.
4.7.1 LED application development
1. Coding
Led_acc.c source code is shown below, The led lamps on the development
board will flash.
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#define LED "/sys/class/leds/led/brightness"
int main(int argc, char *argv[])
{
int f_led;
unsigned char i = 0;
unsigned char dat;
if((f_led = open(LED, O_RDWR)) < 0){
printf("error in open %s",LED);
return -1;
}
for(;;){
i++;
//dat = i&0x1 ? '1':'0';
//dat = (i&0x2)>>1 ? '1':'0';
dat = (i&0x4)>>2 ? '1':'0';
write(f_led, &dat, sizeof(dat));
usleep(300000);
}
}
Page view 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 97 98

Comments to this Manuals

No comments