C is a general-purpose computer programming language used for operating systems, games and other high performance work. It was developed in 1972 by Dennis Ritchie for use with the Unix operating system.

learn more… | top users | synonyms

1
vote
0answers
23 views

How to develop for Mikroe's click boards with free software only?

Hardware offer for the Raspberry Pi When looking for sensors, actuators etc, that are easy to use, one can spot that a Raspberry can host a Pi click shield - extension board for Raspberry Pi® with ...
0
votes
1answer
256 views

Openssl + Raspberry Pi

if I code a program with openssl on a Ubuntu laptop will it work when it is compiled on the Raspberry Pi or are the libraries are different? does the command sudo apt-get install openssl work on ...
0
votes
2answers
85 views

C and C++ Library and where is it located actually?

I'm trying to understand a few simple blocks about programming the Raspberry Pi. My questions are as follows.... I've work on a number of micro-controllers out there and have always used their ...
1
vote
2answers
81 views

Serial Input for the Pi

I am trying to log slow serial data (about 40 bytes per minute at 9600 baud) on the Pi. I have a rough program using wiringSerial which only provides unbuffered serialGetchar I could write a ...
0
votes
1answer
81 views

Why am I getting segmentation fault with GPIO (bcm2835) functions?

So i'm having this function (code below) in c that checks data from my database. If this data equals 255 i want to have a LED to light on one of my GPIO pins (12) on the raspberry pi. I first tried ...
0
votes
1answer
71 views

Locking for bcm2835 library?

I'm using adafruit's DHT22 temperature and humidity sensor, with a modified version of their driver, which in turn uses this bcm2835 library. My modification is that, instead of bailing on failure to ...
1
vote
0answers
227 views

Kernel panic Attempted to kill init! - Android kernel on raspberry pi

I compiled an Android Linux kernel for raspberry pi. The board seems to boot with that kernel but I get the following error when it tries to run /init process. Kernel panic - not syncing: Attempted ...
3
votes
1answer
539 views

Reading GPIO states using C

I've implemented this example to familiarize myself with basic GPIO programming in C. The code demonstrates how to write to GPIO pins but does not explicitly state how to read the state of pins. I ...
0
votes
0answers
601 views

Controlling a servo with hardware PWM using wiringPi

I tried controlling the servo with softPwm using the wiringPi Library but this made the servo stutter. Therefore I want to use the hardware PWM pin on the Raspberry Pi (GPIO18) with the wiringPi ...
1
vote
1answer
216 views

How to upload image from raspivid with curl?

I'm succesfully capturing frames with software described in Pierre Raufast blog. I tried to upload image buffer using IplImage structures or raw buffer (please look at buffer and dstImage in ...
3
votes
0answers
46 views

What is the relation of the frequency and operation execution time?

I am started to program the RPI without any OS, I would like to create a delay function .globl noop noop: nop extern void noop(); void delayUS(uint32 useconds) { uint32 i; uint32 lpnr = ...
1
vote
2answers
711 views

Exchanging Data and Instructions Between Two Raspberry Pi Via Wifi

I have an assignment where I must get two raspberry pis communicating with each other wirelessly. I know that it would be easier to use an Ethernet cable, but I think that it would be more convenient ...
6
votes
2answers
2k views

Trying to execute 'a.out' returns “-bash: a.out: command not found.”

I wrote a simple C program on a different Linux computer. I would compile it using gcc guess.c That would output an a.out file. I would then just type the command a.out, and my C program would run. ...
2
votes
1answer
293 views

How to access raw video data from CSI camera?

I'm developing an augmented reality sort of app for the Pi, but I need access to the video data (pixel data) to tweak things programmatically from a C program, then display the modified frames. How ...
2
votes
1answer
228 views

HD44780 Character LCD C++ Library

I'm looking for a way to connect my Raspberry Pi Model B to my HD44780 LCD, I've tried the Rpi-hw C++ Library but to no avail. You can find the issue about it here. I've been looking ever since for a ...
3
votes
3answers
272 views

Does Raspbian come out of the box with some GPIO C library?

Does Raspbian come out of the box with some GPIO library for C, or if not, does it have any in the standard repository? Sure I could just download and compile any of the libs on my own from .tgz but ...
0
votes
2answers
244 views

Kernel module assembly output

I compiled the kernel modules written in C directly on my Raspberry Pi using this Makefile: obj-m := HelloWorld.o all: $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: ...
3
votes
1answer
910 views

GPIO in kernel module: alternative to gpio_set_value

Goodmorning, i've found out that in a kernel module gpio_set_value and gpio_get_value are very slow (60 useconds). According to this site, ...
5
votes
2answers
3k views

Can I install Git on Raspbian?

Can I get git on Raspbian to back-up my C/C++ files? Do I need to download anything to use git on my Raspberry Pi? Where can I learn to use it?
8
votes
3answers
2k views

Write OS for RPi in C

I already found the Baking Pi tutorials, but they only use assembly. I followed the first lessons but am already wondering how to use C instead. I mean, there is a reason they invented higher level ...
3
votes
2answers
466 views

Record raw PCM from microphone

I have a small project I'm working on that will use real-time audio processing. Until now I've been able to record (via the arecord command) straight to a .wav, but like I said I need real-time ...
1
vote
1answer
988 views

Opencv on a raspberry PI [closed]

What language would be best to use on a raspberry PI with Opencv. Bearing in mind for each language used : Library updates Development Environment including tool kits Performance ...
4
votes
3answers
1k views

GPIO Interrupt debounce

Goodmorning everyone. I was followind this guide http://morethanuser.blogspot.it/2013/04/raspberry-pi-gpio-interrupts-in-kernel.html to create a kernel module handling gpio interrupt. The problem ...
1
vote
1answer
446 views

bitmap display programming in C [closed]

I have been working in DOS in the stoneage with C graphics. I want to display a bitmap that is computed as an array in the format my_bytes(x,y). In dos an fixed pointer address to the hardware bitmap ...
0
votes
1answer
463 views

Why does my SPI-using program in C give varying results?

I've attached a soil hygrometer I bought on ebay to my rpi via an MCP3008 ADC. All I want is a small program that can spit out the current value as an integer. I don't want to use Python... I must ...
1
vote
1answer
665 views

help to understand the dht22 C code

This is the C code that i'm using to read the temperature and the humidity from the DHT22 sensor but i have some doubts about how this code works. #define BCM2708_PERI_BASE 0x20000000 #define ...
0
votes
1answer
308 views

Speed up C code running USB webcam

I have some code that I have adapted to run on a headless Rpi using a usb webcam, it is running a bit slow, so my questions are: If I were to use the GPI pins with a dedicated webcam would that be ...
0
votes
1answer
138 views

Where is my mistake?

I am trying to run a c program which will wait for me to hit a key on a 4x4 keypad and then display the number I have hit. The program I have bit runs but ends just as soon as I start it and I can't ...
0
votes
0answers
2k views

Using the wiringPi I2C Library

I am trying to figure out how this library works (https://projects.drogon.net/raspberry-pi/wiringpi/i2c-library/) . Firstly, what is int fd that all the functions require. It is never stated. I can't ...
1
vote
4answers
2k views

Control robot over WiFi

I am working on a small robot that is driven using a joystick. As of now the joystick is connected to the Pi via USB and is driving the servos as intended. What I would like to do is get rid of the ...
4
votes
2answers
504 views

Get PI's temperature using C

I know you can get the temperature using the tool vcgencmd but I was wondering if there is any API I can use in C to get the temperature programatically without reading the stdout of vcgencmd ?
0
votes
2answers
7k views

How to compile C files in terminal

Question Can someone please tell me how to compile from the command line in a clear, concise way. Preferably, my programs will be written in a real text editor (such as leaf pad). Background I am a ...
1
vote
2answers
1k views

I2C: Raspberri pi as a Slave

I am trying to make two raspberry pi communicate through I2C protocol. I got little information that how I can code as a master in C using i2c-dev.h. So my question is how to make one of my raspberry ...
2
votes
2answers
1k views

Raspbian source code

I´m using Raspbian on RaspBerry Pi and it´s working ok, but now I want to modify the distro according to my needs. I know the source for the kernel is found in kernel.org, but I haven't been able to ...
4
votes
1answer
703 views

Read the value of an GPIO output pin

I've made a program using the wiringPi library that assigns GPIO pins to toggle at the press of associated number keys. I'd like my program to show the current status of the pins, even if they are ...
5
votes
2answers
1k views

Cannot read input to SDA/SCL GPIO pins

I'm totally stumped trying to figure out how to read input to the SDA/SCL GPIO pins on the Pi. Context: I have a Wiegand 26 RFID reader that I would like to read data from. The idea is that I get the ...
2
votes
2answers
880 views

nanosleep won't sleep short time

I trying to toggle one of my GPIO pins at a specific frequency, at the kHz range. I set up the wiringPi Library, the blinking example seems to work just fine.So I modified the code, so it will ...
1
vote
0answers
226 views

va_arg with double returns wrong value

In the tests for blocks runtime implementation, I'm having a test fail because a block that takes a variable number of arguments is not getting the right value for a double that is passed in. The ...
4
votes
1answer
788 views

C/C++ sound API for games

I have a game that, up until now, uses SDL_mixer for playing MP3 sound effects. Works on Linux, Windows, OSX. At the moment doesn't work on 64 bit Linux, so I was thinking of switching to FMOD. ...
9
votes
4answers
3k views

Which CPU flags are suitable for gcc on Raspberry Pi?

gcc takes the -mcpu= (or -march=) flags to produce optimized code for a particular CPU type. There's a plethora of arm variants, and the gcc Arm target also provides numerous FPU types. Which ...
1
vote
1answer
434 views

sample speed i2c

If running standard release of debian on my Rpi. How fast can I sample the sensor readings through i2c and save values? Why Im asking, I tried to read a DS18B20 and save it,s values (wrote the ...
3
votes
1answer
654 views

How do I connect a DS18B20?

I'm trying to connect a DS18B20 to the GPIOs. I have successfully done so electronically, but I could only code the reset function because it's not that time critical. It is OK for that function to ...
6
votes
2answers
3k views

How to use Java to read/write data to/from the header pins?

I just got Java running on my Raspberry Pi which took a lot more screwing around than i had hoped. I want to be able to read/write data to/from the header pins from Java. How can I do this? Do I need ...
4
votes
2answers
614 views

Outb in C to access GPIO

I have a basic understanding of the GPIO on the RPi. I want to adapt some of my previous software which interfaced my project board via the Parallel port via direct output to the PP address (0x378) ...
11
votes
1answer
1k views

How can I detect that I'm compiling for Raspberry Pi?

As Raspberry Pi needs a bit of special code (I'm talking about C/C++) for accessing some hardware features (e.g. a call to bcm_host_init()). I'm looking for a reliable and elegant way to detect this ...
7
votes
3answers
919 views

Can I program C within a nice IDE on desktop computer for the RPi

I'm from a Microsoft Windows development background, I'm happy with the IntelliSense and code navigation features, is it possible for me to install an IDE, such as Eclipse, [I'm assuming it's probably ...
22
votes
1answer
4k views

How does memory-mapped I/O addressing work?

How does memory-mapped I/O addressing work? I'm trying to understand a sample supplied I2S: Anyone got it running?. Configuring Clocks: #define BCM2708_PERI_BASE 0x20000000 #define ...
5
votes
2answers
2k views

Can't access shared libraries when running with sudo

I'm trying to get a demo working writing PCM to the I2S; I've created a small demo program that gives an error when I run with the following command ./demo stereo_small.wav can't open /dev/mem So I ...