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
1answer
30 views

Port forwarding - Not sure which community to post this in

I would like to assure my boss that port forwarding a raspberry pi is safe. I plan to be doing port forwarding the web port, so I can run an Apache server, and also port forwarding my own program (C ...
1
vote
1answer
20 views

Is there any way to further increase the speed of clk in spi?

At first, i tried to communicate with MCP3008 with raspberry using wiring Pi library and as it communicates through the spi driver, the data retrival of it is quite slow. Then, i opt for the next ...
0
votes
1answer
18 views

Cross compiler gcc on rasbian

Is it possible to install cross compiler on rasbian? I mean arm-linux-gcc. I would like to try compile cross platform project on rasbian insted of on virtual machine with ubuntu.
1
vote
0answers
23 views

Generation of clk signal by the use of the SPI Protocol

The model which i am using is Raspberry Pi 2 Model B. The use of spi came across when i need to convert analogue value into digital value through the use of the MCP3008 chip. I would like to mention ...
1
vote
0answers
16 views

Receiving serial data from xbee

Hey I am using this source code for an application of reading serial data from an xbee connected to my windows machine to the raspberry pi. The data being sent is the y position of my left and right ...
0
votes
0answers
21 views

Running executables through a RPi webserver [closed]

I am on a small project to mimic a radio remote with the RPi in order to control home automation equipment. I'd like to be able to, for example, turn on and off a light. I already have the C program ...
0
votes
0answers
25 views

Difficulty detecting bluetooth devices using hcitool

On my Raspberry Pi 3B, I'm unable to use hcitool to detect bluetooth devices. However, I can detect bluetooth devices using bluetoothctl: pi@pi1-3b:~ $ hcitool scan Scanning ... pi@pi1-3b:~ $ ...
1
vote
0answers
50 views

Raspberry Pi 3 BLE scanning failure

I am trying to implement the next code to scan for BLE devices: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include <bluetooth/...
1
vote
0answers
27 views

Is Joan's pigpio rotary Encoder C library callable from python ctypes?

Hi I'm using python class Rotary Encoder to implement a Position PI on a stepper motor and using this encoder H6BM-1000-500-IE-S-H The code is working quite well , however i'm getting an error of ~...
0
votes
1answer
50 views

Problem running C program from rc.local

I have a C program running to do some stuff when i push a button on my raspberry pi. When i run this program from a shell window, everthing works fine. However when i run the exact same program from ...
0
votes
1answer
51 views

How do I read just the Pi's serial number with a program coded in C?

I'm trying to write a small C program that reads the Pi's serial number, just the serial number and not all the other information, to do this I'm using fseek here is my code, based on a few C examples ...
0
votes
1answer
53 views

Pin GPIO5 set to output by default with constant 2.4V output during and after boot

I have been experimenting with rpi in the last few days and made a simple user interface circuit, it contains a button and few LED's attached on top of rpi as you can see below. It works fine but the ...
0
votes
1answer
94 views

Is it possible for motion to process an mjpg-streamer live feed and send alerts to a client viewing an NGINX webpage live? Is PubNub a solution?

I already have a web server set up with NGINX showing a live webcam feed from the mjpg streamer as part of a laser tag game where the idea is for the user to be able to view a live camera stream by ...
1
vote
0answers
60 views

Raspberry Pi 2 - bare metal DMA

I am trying to make DMA on bare-metal raspberry Pi2 working. Unfortunatelly it does not and I have got no idea why. Below is my source code: typedef struct{ UINT32 controlStatus; UINT32 ...
1
vote
1answer
35 views

Boilerplate c pocketsphinx mic input

What I am trying to do is have pocket sphinx get my mic input and have it then translate and based on the results compare it to predefined words and then execute a command/script. I was able to get ...
0
votes
0answers
42 views

Use a PIR sensor to detect motion and activate a piezo speaker

Im trying to write the code for a program that will use a PIR sensor to detect motion and then trigger a piezo speaker. I was following this tutorial https://pimylifeup.com/raspberry-pi-motion-sensor/ ...
0
votes
1answer
51 views

Why did my code not stop when the command line closed?

I was running some C code that drove a stepper motor. The general flow was that it would take user input for the number of steps, maximum speed, and acceleration (scanf commands). Then it would go ...
1
vote
1answer
162 views

WiringPi code issue resolved

Resolved. Thanks for all the help.
1
vote
0answers
31 views

WiringPi traffic light in C [duplicate]

I am working on a project for my C programming class and need to use wiringPi on my raspberryPi. I need to create a traffic light (like a real one- red to green to yellow to red, etc.) and a ...
1
vote
2answers
102 views

python library to generate pulse frequency of “n” hz

I'm trying to make a function which would output a pulse frequency , given a Ts (time.sleep(ts) on my function) The function is for later use on an acceleration ramp for a stepper motor , as the ...
0
votes
1answer
92 views

Write interrupt data into a Raspberry pi Register on C?

I'm trying to read interrupts and detect direction of interrupts from an encoder using a raspberry pi , it is USdigital Brand "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , the thing ...
0
votes
1answer
45 views

C Program compilation problem [closed]

I wrote a program using nano and tried to compile it using gcc command on Lx-terminal. It's showing stray error. Can anyone tell me what is the problem? For simple "hello world" program also is ...
1
vote
1answer
34 views

Is Raspbian signal(2) handling persistent or non-persistent?

I've been looking at the signal handling in a library I am using in a project of my own {Joan's pigpio as it happens} but having read the Raspbian man pages for signal(7), sigaction(2) and finally ...
0
votes
0answers
361 views

Raspberry Pi 2 B HX711 Load Cell Amp Issue

I am working with a Raspberry Pi 2 B. I am trying to get load readings from a load cell like (uxcell Electronic Balance Weighing Load Cell Sensor) through a HX711 load cell amplifier (following a ...
3
votes
2answers
99 views

Polling GPIO pin from C, always getting immediate response

I'm using C to read the GPIO pins from /sys/class/gpio. I have a separate thread that I'd like to get notified when a pin changes value, so I'm opening the file for read, then calling poll() on it, ...
0
votes
1answer
53 views

NXP XTRINSIC-SENSE-BOARD using C

https://www.element14.com/community/thread/37836/l/reverse-engineered-sensorso-with-source https://github.com/larsch/rpi-mems-sensor Hello Everyone :) I have a raspberry V1 and a NXP senseboard, ...
0
votes
1answer
50 views

What does libcofi do?

This answer rather vaguely states "libcofi-rpi.so is a hack to speed up certain memory operations." Apart from the fact that the file is called libcofi_rpi.so on my machine, what exactly is libcofi ? ...
0
votes
0answers
114 views

Reading the MCP3304 over SPI in C with WiringPi

I wish to use the MCP3304 ADC with the RPi 2B to read a potentiometer. I have some basic understanding of how SPI works: namely, that to read from the chip I need to send it one bit every time it ...
1
vote
2answers
217 views

Controlling a common RC car

I need to test my computer vision stack written in C++ on a mobile robot and I need to control the robot from a Linux ARM board (which can be a Raspberry Pi). Since the specialized wheeled robot ...
0
votes
0answers
65 views

getnameinfo() always rises “Illegal opcode” error from Valgrind

I have a Raspberry Pi 2, running Raspbian. I'm trying to get informations by IP addresses, such as aliase(s), hostname(s) and so on. According to the man, gethostbyaddr is obsolete: better use ...
1
vote
0answers
92 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 ...
3
votes
1answer
57 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
204 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 *argv[]...
0
votes
0answers
32 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
118 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
403 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
971 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
92 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
95 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 wiringpi....
5
votes
1answer
353 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
144 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
171 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
113 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
81 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
1k 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
198 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: //...
4
votes
1answer
203 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
311 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
105 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
104 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 ...