Hi everybody,
I am just starting with a new RPi2B and would like to ask the community if you can give me some hints for accessing the GPIO pins as well as for the programming of serial interfaces from C programs. Which libraries do I need and how can I include these libraries into the gcc compiler?
Maybe you can give me some examples. I have got experience with C programming, however, I am new with the Raspberry Pi stuff and Raspian.
Thanks a lot for your help.
Re: GPIO and serial IF programming with C language
Try with this - without redundant overhead:
http://www.pieter-jan.com/node/15
http://www.pieter-jan.com/node/15
- What Can a Thoughtful Man Hope for Mankind on Earth, Given the Experience of the Past Million Years?
- Nothing.
Kurt Vonnegut, Cat's Cradle
- Nothing.
Kurt Vonnegut, Cat's Cradle
Re: GPIO and serial IF programming with C language
This will give you bare bones access. You could also look at wiringPi.enedil wrote:Try with this - without redundant overhead:
http://www.pieter-jan.com/node/15
https://projects.drogon.net/raspberry-pi/
This seems to be installed as standard in Jessie. It includes all the basic GPIO functions, serial and much more.
I have not used it in anger, I just checked that the header file and library were there. There must be plenty of people around here with far mor knowledge.
Re: GPIO and serial IF programming with C language
if you don't mind to read a little bit in German (most is in English, though):
http://www.mindstormsforum.de/viewtopic ... 689#p67924
http://www.mindstormsforum.de/viewtopic ... =15#p67785
http://www.mindstormsforum.de/viewtopic ... 689#p67924
http://www.mindstormsforum.de/viewtopic ... =15#p67785
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}