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
9 views

Using INT interrupt line on PCF8574 I2C 8-bit IO-expander on Bit-banged RPi GPIO?

I am planning to use a triplet of RPi GPIO pins as an additional bit-banged I2C bus on my RPi. This will be run at a lower than typical rate (and level-shifted via a 3.3 to 5.0 V I2C shifter unit) so ...
0
votes
0answers
11 views

Raspberry pi good matrix multiplication library [on hold]

What matrix multiplication library would you recommend for Raspberry Pi 2? I think about BLAS or NumPy, What do you think? I'm wondering if there is an external hardware module for matrix ...
3
votes
1answer
29 views

Configure Alt GPIO using sysFS

I have a Model B Revision 1.0 + ECN0001 that I am making a program in C to read and control a HCTL-2022 Quadrature Decoder using the GPIOs by way of sysfs. It's working great, but now I would like to ...
0
votes
1answer
34 views

Cross Compile Error Using arm-linux-gnueabihf-gcc

I am trying to cross compile a C binary from Ubuntu Trusty Tahr x64 to Arch Linux ARM on my Raspberry Pi Zero. Here is my hello-world.c code: #include <stdio.h> int main(int argc, char ...
0
votes
0answers
20 views

TLC5940NT library for Raspberry Pi in C

I've been trying to make TLC5940NT work with my Raspberry Pi, but everything I tried didn't help me light any LED - hence I think that I am not able to communicate with the chip. The first thing that ...
3
votes
1answer
39 views

Any tutorials for the 10Dof DfRobot IMU? ADXL345 - HMC5883L - ITG-3205 - BMP085

I would like to connect this Imu to the Raspberry Pi via I2C. I am looking for a C/C++ or Python code to use the data provided by this imu. It integrates the ADXL345 accelerometer, HMC5883L ...
3
votes
2answers
71 views

I2C using wiringPi or IOCTL in C, more than 2 bytes

I'm willing to send 20 bytes at a time to Arduinos via I2C bus. I'm writing a C program (that will become a Daemon) that should achieve this, and thus I downloaded via Git the last wiringPi library, ...
4
votes
2answers
460 views

GPIO library for C

I want to utilize the GPIO pins on my Raspberry Pi 2, but I'd rather not use Python since I personally dislike the language. However, I cannot seem to find any information regarding the use of C, only ...
0
votes
1answer
43 views

Sequential Control - time and signal based in C

i want to program in C a simple sequential control with the raspberry. The current task is: If a button is pressed, something (e.g. a LED) shall be switched on for 5 seconds and then go off itself. ...
0
votes
0answers
35 views

Kernel Module Driver using GPIO PIN as Input

I am beginner in C programming. I want to make kernel module and user space program based on Raspberry Pi GPIO for input data on GPIO pin X. I don't want to use other library e.g. broadcom or ...
4
votes
1answer
124 views

Using BCM GPIO pin numbers with wiringPi C library

I'm a GPIO newbie experimenting with getting my Raspberry Pi to blink an LED with C using the wiringPi library. The example code at http://wiringpi.com/examples/blink/ (blink.c) compiles perfectly and ...
0
votes
0answers
69 views

help with OpenCV on Raspberry Pi 2

I have installed OpenCV 2.4.9 and 3.0 on my Raspberry pi 2. I have done everything as he said in this tutorial https://www.youtube.com/watch?v=_DMqGTsEo30 . But in the end of video he want to start a ...
3
votes
1answer
78 views

Serial connection Arduino - Pi

I am having an Arduino Nano sending "48" or "49" via a serial connection to a Pi. I'd like to use this input, but for some reason the connection always cuts out after a few seconds with the following ...
1
vote
1answer
60 views

How to make the DHT11 sensor work with direct memory access(dev/mem method)?

So, I'm trying to make the DHT11 sensor work without any library on a Raspberry Pi 2 using C. I'm using this tutorial to manipulate the GPIO pins registers so i can set them as input,output, HIGH and ...
1
vote
0answers
37 views

How to make the DHT11 sensor work with the sysfs gpio manipulation method?

So i am trying to connect a DHT11 sensor to my Raspberry Pi 2. My wiring is correct, since i got it working with the wiringPi library. Since i don't want to use someone else's library I've created ...
0
votes
3answers
294 views

Serial Communication C/C++

I was wondering if its possible to communicate between Arduino ann RPi using Serial Communication in C/C++, it's possible with python but didn't find a suitable library for C/C++ ?
3
votes
2answers
115 views

How to set Raspberry Pi GPIO pins to input or output using clean C?

How can access the GPIO pins in C without writing to the sys/class/gpio directory, in a way that would allow me to create my own interface? I would like to end up able to do something like this: ...
2
votes
1answer
83 views

How to display graphical text without X using C?

Using the Raspberry Pi 2 with the official 7" touchscreen, I want to display some high quality text without using an Xorg server. I'm looking for APIs that provide simple functions such as: ...
3
votes
1answer
245 views

How do I read the GPU temperature in C?

I am making a graph on the temperature using a NTC resistor and also by reading the CPU temperature, however I'd also like to read the GPU temperature. I read this answer explaining briefly how to ...
0
votes
2answers
60 views

How to continiously monitor Wiegand readers using pigpio library?

How do I need to modify the C example from http://abyz.co.uk/rpi/pigpio/examples.html for continious monitoring of Wiegand readers? I need to run it as background process. For now I have a code: ...
0
votes
0answers
59 views

Mouse Events for Omxplayer in Raspberry Pi

My mouse cursor always gets hidden when I play videos through Omxplayer. For my codes written in Gtk-2 C, I have found a solution as key-events which when pressed quits or kills omxplayer. But I ...
0
votes
0answers
31 views

Cross Compilation Delay in Live Streaming

I have designed a Glade file and written codes in Gtk2, C language in Ubuntu(local host) to play live streaming of cameras, I cross compiled with the Raspberry Pi(remote host)...everything went fine, ...
0
votes
0answers
50 views

Raspberry Pi to Roomba communication serial port

I'm developing a program in C where I want to communicate a Raspberry Pi with the roomba robot by the serial port, and I've got some problems. First of all, I have the source code where I connect to ...
1
vote
1answer
248 views

How do I access the Wii Nunchuck using WiringPi

The Wii nunchuck is an I2C accessible device and can be wired to the I2C pins of a Pi. How do I read the data from a Wii nunchuck in C using the WiringPi library?
0
votes
1answer
522 views

softPwm of wiringPi for servo … where is the problem?

I have a Python code which controls an ESC & servo fine. Now, I'm trying to develop a similar code in C language using wiringPi. However, the C codes don't work. The Python & C codes are ...
0
votes
0answers
110 views

Raspberry Pi: Play mp3 file, link error

My first post.. so, pl let me know if this is not the right place. For my first real project on Raspberry Pi, I wanted to create an app to play mp3 files using C. My choice of IDE is Eclipse (Luna) ...
3
votes
1answer
372 views

BMP180 allow to read calibration but fail to read data

I have BMP180 connected to my RPi, I can read calibration data from it, but when I try to get pressure / temperature data -- I get 80 00 for temp and 80 00 00 for pressure (mean -- 'just-after-reboot ...
1
vote
0answers
67 views

Is it safe to read/write register values without Data Memory Barriers?

I'm trying to utilize the BCM2835's BSC/SPI slave peripheral to use the Pi as an effective I2C slave, however I've been running across some segmentation faults when I try to write to the configuration ...
1
vote
2answers
108 views

Not able to fetch register values using Mike M's BCM2835 C code

I'm attempting to utilize the bcm2835_peri_read(uint32_t*) function from Mike M's BCM2835 code, however console-output-debugging indicates I'm continually getting back my address. I'm using g++ on ...
0
votes
0answers
683 views

SunFounder Raspberry Pi CPU/RAM Display Mini LCD 84*48 PCD8544 Shield For Model B+/B

this display is driving me nuts! i almost tried all available samples/libraries. the only one i got working was this one https://github.com/ronanguilloux/Raspberry-Pi-Utils all the other ones ...
1
vote
0answers
130 views

Python script always throws exception the first it is ran after reboot

I am trying to build a home automation system with Raspberry Pi connected to Arduino Uno via USB. Everything works but the Python script that I am using for reading variables from Arduino is always ...
2
votes
1answer
589 views

How to compile OpenCV software on Raspberry?

I want compile an OpenCV program on Raspberry, the problem is that I didn't figure out how to do so. I installed OpenCV following this guide. $ pkg-config --modversion opencv 2.4.1 OpenCV can be ...
2
votes
3answers
222 views

How to create an GPIO event loop with C (Or Objective-C)?

I made a board that attached a 1602 LCD and three buttons to the GPIO pins of the Pi. Now I need to write a software to go with it. The software runs under Raspbian. The software need to interrupt ...
5
votes
3answers
428 views

How can I get a clock in C accurate enough to control a servo?

I want to write a program that controls a servo motor myself using a pi B+. Controlling the motor involves sending 1.5 millisecond pulses along a GPIO pin every 20 milliseconds. I have tested the ...
1
vote
0answers
228 views

BCM2835 Event Detection

I've got 2 motors, 2 encoders, a motor controller, and my B+ wired up. My B+ is running Arch with kernel: Linux drd 3.12.35-1-ARCH #1 PREEMPT Tue Dec 23 07:14:51 MST 2014 armv6l GNU/Linux. The 2 ...
1
vote
1answer
79 views

How to use headerfile from diffrent libraries in same code

In raspberry pi , we got two famous libraries (a) bcm2835 and (b)wiringpi. So,I want to use some header files from library bcm2835 and some from wiringpi in a same code. Is it possible to do so. If ...
2
votes
1answer
359 views

Unable receive character properly in UART

I am trying to send and receive character using UART (GPIO14 as Tx & GPIO15 as Rx). I can transmit character successfully which I can check on minicom. Now I have short my RX and Tx pin so that I ...
3
votes
1answer
232 views

Cannot use particular pin in GPIO

I am trying to blink a LED on a Raspberry Pi using GPIO 4 (P1.7). Here is my code: #include <bcm2835.h> #define PIN RPI_GPIO_P1_7 int main() { bcm2835_init(); bcm2835_gpio_fsel (PIN, ...
2
votes
1answer
1k views

Want to run a simple C program on startup of pi

Im new to linux and the pi . Im stuck with this situation where Iv been trying to run a simple LED blinking C code as a test , so that it will be executed during startup Code works fine when its ...
1
vote
1answer
588 views

programming raspberry pi with C/C++ simd instructions [closed]

Is it possible to use C/C++ SIMD instructions in a program and run it on a raspberry pi model b+ ? The raspberry pi has an arm processor, and there's a C/C++ SIMD instructions set for the ARM ...
0
votes
0answers
57 views

Serial line hangs after first call

I have written a short program to monitor a serial line using the uart on GPIO-Pin 8/10. It works fine the first time I start the program, but hangs without any output the 2nd time I call it. To be ...
12
votes
3answers
692 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 ...
2
votes
1answer
2k 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
65 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
123 views

SPI to soft UART [duplicate]

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
45 views

Receiving a nack (clockstretching) while measuring distance [closed]

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
2k 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
1answer
105 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
947 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
442 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. ...