Since I missed my Wednesday publication date I’m doing one post today. Just to keep the ball rolling.
Hope you like it 🙂
Due to too much work I completely missed Wednesday publication. Sorry 🙁
… so no blog post today. See you next week.
Working on some stuff, so no post today..
Well, I’m playing with idea to use ICL7106 as A/D converter to connect to micro controller – although it is used to display value (on LCD). Not sure if it will work and don’t know how to do a chip select, but there… just an idea.
Still – I’ve bought some serial ADC converters for the project I’m working on.
Check the datasheet of dev board (we are using APF28-dev as stated previously) and look for GPIO ports. The name is usually GPIOx_y (x is bank number and y is pin number) and on APF28-dev the formula is: x*32+y. Connect the LED between selected GPIO port and GND.
Calculate the number which you can use to create proper device.
Let’s say you got the number $number.
You should do following:
echo $number > /sys/class/gpio/export echo out > /sys/class/gpio/gpio$number/direction echo 1 > /sys/class/gpio/gpio$number/value
After that you can manipulate the LED with following code:
sprintf(buf, "/sys/class/gpio/gpio<port_number>/value", gpio); fd = open(buf, O_WRONLY); // Set GPIO high status write(fd, "1", 1); // Set GPIO low status write(fd, "0", 1); close(fd);
Replace <port number> with value of $number.
Writing 1 to the GPIO lights the LED (obviously).
You can do echo programmatically to avoid manual work.