Questions tagged [c]

For questions pertaining to compiling C programs on the Raspberry Pi.

Filter by
Sorted by
Tagged with
1
vote
2answers
2k views

Rpi Neo-6M / Neo-8M GPS Module Setup / Fix / Update Problems

Hi i'm tryng to change the update rate of my gps tracker(neo 6m ublok) i know the byte that i need to send are 0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A i've tried echo -e &...
2
votes
3answers
2k views

Controlling Raspberry Pi GPIO with c and Python

I was searching for C and Python Libraries which support Pi4.
29
votes
2answers
21k views

How does memory-mapped I/O addressing work?

How does memory-mapped I/O addressing work? I'm trying to understand a sample supplied I2S: Anyone got it running?. Configuring Clocks: #define BCM2708_PERI_BASE 0x20000000 #define ...
2
votes
3answers
10k 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 ...
25
votes
4answers
21k views

Which CPU flags are suitable for gcc on Raspberry Pi?

gcc takes the -mcpu= (or -march=) flags to produce optimized code for a particular CPU type. There's a plethora of arm variants, and the gcc Arm target also provides numerous FPU types. Which -mcpu=/...
-3
votes
2answers
9k views

UART interrupt in Raspberry PI with c or c++

I want use GSM module with raspberry pi i can send data bur for receiving data i want to use a interrupt function.pulling is valuable for me.
3
votes
3answers
13k views

How to enable SPI1 and SPI0 at the same time?

I have installed a LCD screen that use my SPI0 bus and I2C but i want to connect my RFID reader to the same raspberry. My lcd screen can you see here: https://www.adafruit.com/product/1601 SPI1 will ...
8
votes
1answer
7k 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 ...
12
votes
2answers
9k 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 ?
8
votes
2answers
9k views

GPIO library for C [duplicate]

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 ...
5
votes
1answer
4k 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 ...
4
votes
1answer
5k views

how to generate smooth frequency ramp

I want to drive a stepper motor driver hardware by its pulse and direction inputs. I need to use a ramp function in order not to make stepper motor stuck. I need to increase the pulse frequency ...
4
votes
2answers
2k views

Outb in C to access GPIO

I have a basic understanding of the GPIO on the RPi. I want to adapt some of my previous software which interfaced my project board via the Parallel port via direct output to the PP address (0x378) ...
4
votes
1answer
5k 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 ...
3
votes
1answer
376 views

Pi locking up trying to use rising/falling edge detection

I have a B+ v1.2, with a motor controller and 2 quadrature encoders setup. It's running Arch: 4.19.69-2-ARCH armv6l. It's completely locking up, requiring a plug-pull when either of the encoders ...
3
votes
1answer
702 views

Does select/multithreading make sense when dealing with multiple DS18B20 and GPIO reads simultaneously?

As you may know, DS18B20 is not the quickest sensor and answers after around 750ms delay but, afaik, 1-wire is a relatively quick bus. I have multiple sensors connected to the board, which means if I ...
3
votes
2answers
3k views

PN532 NFC module not working on Pi 3

I am trying to discover why my Pi 3 is not able to communicate with PN532 NFC module. I'm using a couple of libraries to do it (libnfc and NPM PN532), but it's not working. I followed the steps of ...
2
votes
3answers
894 views

How to know if time is synced?

I'm writing a software in C and it is running as a systemd service. I need the service to run after time has synced or alternatively, I need a way for my C program to identify if time has synced. I'm ...
2
votes
1answer
1k 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 ...
2
votes
0answers
814 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 ...
2
votes
2answers
2k 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 ...
1
vote
1answer
802 views

Traffic light in C wiringPi

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
1answer
913 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 ...
0
votes
2answers
4k 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 ...
-1
votes
2answers
567 views

Interface AD7193 with Raspberry Pi

I have been trying to interface an ADC with raspberry Pi namely AD7193 via SPI . For that I have enabled my SPI and installed spidev on my pi. but i dont know what to do next in order to get the ...