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

8
votes
3answers
542 views

Push buttons getting too many events

I am writing a mp3 player that writes info to a LCD display, I'd like to convert it from using the keyboard to using push buttons but I'm constantly getting too many key presses. I've tried pull up ...
0
votes
1answer
62 views

Cross Compiling Protobuf for Raspberry Pi

I'm trying to cross compile google Protocol buffers for the Raspberry Pi, so I can cross compile my own software. I've installed protobuf-2.6.0 to the directory ~/ExternalLibs/protobuf-2.6.0, where I ...
0
votes
1answer
30 views

Getting a return from the terminal in c [closed]

I am building a project which uses the raspberry pi as an embedded PC. In short the device is a data logger which records data and then downloads to a memory stick. Most of the programming is being ...
0
votes
0answers
16 views

SPI to soft UART

Is there a way to use the SPI on pi for UART communications without any external hardware? Is there a library in C for this?
1
vote
0answers
35 views

Receiving a nack (clockstretching) while measuring distance

So I have written a small piece of software in C to measure distance with an ultrasonic distance sensor and then print it to the screen: uint8_t TxData1[2] = {00,0x51}; uint8_t TxData2[1] = {0x03}; ...
7
votes
2answers
118 views

Turn LED on and off with switch

I'm trying to write code to get an LED to turn on when it is off and to turn off when it is on using a tactile push button switch. I've written what I believe to be is the right code with the wiringPi ...
0
votes
0answers
42 views

Fast OS for embedded system

I'm creating a project with raspberry pi and I need an "os" which boots in a few seconds when the power is turned on. The os has to have the following features: audio driver (3.5mm) c/c++ running ...
0
votes
2answers
89 views

Interfacing with a Winbond W25Q64BV flash chip via SPI

I'm trying to interface with a Winbond W25Q64BV flash chip via SPI. I started off by testing it on Arduino (target is a Raspberry) as I found a few implementations before I got started. Most notably ...
0
votes
1answer
56 views

Sending i2c commands from arduino to pi

The RPi and arduino are connected by I2C and the arduino sends coordinates to the RPi through the wire library. However, the RPi only receives and prints out 0 when it should print out the coordinate. ...
2
votes
2answers
82 views

From raspi to laptop python3 vb.net/c# [closed]

Hello im enquiring about using data from a raspb-pi via python to then access it in c# in visual studio for an impending app I will make, what is the best way to go about this. To extend atm I am ...
0
votes
1answer
50 views

Serial string not being read consistantly

If I send the following string to the rpi echo "#q10" > /dev/ttyUSB0 Why does the whole string not get read each time its sent? This is the app output The code is as follows. I am using ...
0
votes
1answer
26 views

How to detect specific string over serial using c

I am connecting my raspberry pi to a device using the serial port to record data coming from the device at 19.2k. Currently I am using a usb to serial adapter, but this could change in future. The ...
0
votes
1answer
27 views

cant create shared library on RPI (Raspbian)

I want to create shared libray on RPI. this is successfuly done in ubuntu desktop PC, but not on RPI (Raspbian) shared.c #include "shared.h" unsigned int add(unsigned int a, unsigned int b) { ...
0
votes
1answer
117 views

DHT22 code not working (datasheet instruction and xenomai)

I'm trying to read temperature form DHT22 using Raspbian patched with xenomai real time system. I'm following steps of datasheet page 4 using gpio4. . the circuit is correctly wired(I can read with ...
-1
votes
1answer
58 views

C shell doesn't work properly

I tried csh in my raspberry pi model B today.I try run my program which includes if loops and shell doesn't accept "endif" however, when i use "fi" program runs and operators like # and @ doesnt ...
0
votes
0answers
88 views

Fast os for Raspberry Pi

I'm creating a project with raspberry pi and I need an "os" which boots in a few seconds when the power is turned on. The os has to have the following features: audio driver (3.5mm) c/c++ running ...
0
votes
0answers
40 views

C# VCNL4000 Make error with ../version.h

I was trying to use a proximity sensor with the Raspberry PI called the VCNL4000 using this git:https://github.com/silentbobbert/pi_sensors . An existing solution is shown in this video: ...
-1
votes
2answers
92 views

local and global variables in bare metal programming

I'm developing simple blink led for PI without OS (bare metal) when setting the variable tim inside the kernel_main, the led still on and doesn't blink. but when setting variable tim global (outside ...
0
votes
1answer
107 views

I2C LCD w/ buttons - C

I'm have a 16x2 LCD button shield for RPI similar to Adafruits. It works using the provided Python library so the setup is ok. The problem is I can't find any working C code or library to work with ...
1
vote
1answer
271 views

Create a Terminal Menu GUI in C

I found this very cool Python menu that will display a GUI menu in the terminal. Is this possible to do in c? I've compile a little hello world in gtk+ 2.0, but it looks like it will only run in X11. ...
2
votes
2answers
87 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
620 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 ...
1
vote
2answers
241 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 worked on a number of micro-controllers out there and have always used their ...
1
vote
2answers
239 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
295 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
120 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
279 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
2k 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
753 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 ...
3
votes
1answer
280 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 ...
4
votes
1answer
86 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
1k 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
7k 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
373 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
310 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
403 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
361 views

Kernel module assembly output (Solved)

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
1k 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
5k 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?
10
votes
3answers
2k views

Write an OS for Raspberry Pi in C

I already found the Baking Pi tutorials, but they only use assembly language. I followed the first lessons, but I am already wondering how to use C instead. I mean, there is a reason they invented ...
3
votes
2answers
620 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
1k 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
2k 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
755 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
2answers
826 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 ...
2
votes
1answer
1k 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
346 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
156 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
3k 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 ...