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

0
votes
0answers
29 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
1answer
37 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
37 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
70 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
36 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
22 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
21 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
99 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
50 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
79 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
35 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
84 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
95 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
203 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
78 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
579 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
214 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
202 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
266 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
113 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
256 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
1k 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
737 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
273 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
69 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
5k 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
359 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
294 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
365 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
337 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
571 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
692 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
759 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
333 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
154 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 ...
4
votes
2answers
714 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
11k 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
2k 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
2k 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
1k 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
2k 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 ...