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
votes
0answers
44 views

Write data received from com port to .txt file

Basically I had a com port connected to raspberry pi and I am trying to append the data received into a .txt file. So far I'm only successful in opening the file.. How should I edit the existing code ...
0
votes
1answer
61 views

BCM 2835 library vs WiringPi library [on hold]

What is the best library of these two? What are deference of these two libraries?
1
vote
1answer
92 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
166 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
42 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) ...
2
votes
1answer
183 views

BMP180 allow to read calibration but fail to read data

I have BMP180 connected to my pi, 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
29 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
83 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
384 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 ...
0
votes
1answer
155 views

Python, C, I2C, calling binary with arguments, and printing output [closed]

I have a C binary that takes 1 argument. I need to have Python run the binary, and return the output. Using subprocess.Popen (and check_output), the C binary fails when trying to write to the I2C ...
0
votes
0answers
79 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 ...
1
vote
1answer
426 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
131 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 ...
4
votes
2answers
323 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
122 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
51 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
288 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
144 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
589 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
371 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
40 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
655 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 ...
1
vote
1answer
923 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
49 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
79 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
43 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
803 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
76 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
547 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
296 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
133 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
159 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
33 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
87 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
292 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
122 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 ...
-2
votes
2answers
122 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
57 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: ...
0
votes
2answers
182 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
198 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
574 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
251 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
960 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
757 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
444 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
496 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
161 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
447 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 ...
4
votes
1answer
3k 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
903 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 ...