bcm2835 | Go package for the bcm2835 as used in the Raspberry Pi
kandi X-RAY | bcm2835 Summary
kandi X-RAY | bcm2835 Summary
Go language package to control the Broadcom BCM 2835 as used in the Raspberry Pi. Builds on Mike McCauley's C lib with the same name. The package needs Golang 1.1 since the stable 1.0 release doesn't provide a stable version of cgo. Needs to be run as sudo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bcm2835
bcm2835 Key Features
bcm2835 Examples and Code Snippets
Community Discussions
Trending Discussions on bcm2835
QUESTION
I'm trying to connect 6 mcp2515 over spi0. I have adapted an SPI overlay to add the neccesary chip select lines. My new SPI overlay looks like this:
...ANSWER
Answered 2021-Jan-14 at 08:15It's working!!! As i mentioned in my first post only one board was working (can1 spi0.4), after i rechecked the other two non working boards i discovered that one had a hardware damage causing the other board not to work as well. As a final conclusion my spi and mcp overlays are fully functional!
Regards Antmar
QUESTION
I am using ::http::geturl -query
to issue an HTTP POST request with a small json payload to an ESP8266 (a 3rd party commercial device) from a rPi. It works when sent over eth0 but fails when sent over wlan0. tcpdump shows that sent over eth0, the message is sent as a single packet but when sent over wlan0 the payload is being split from the headers and sent in a second packet. The ESP8266 most likely due to having overly simple implementation of its packet receivers and/or http server doesn't appear to handle this splitting. It issues a 200 OK
response after receiving the packet containing the headers and doesn't process the payload part of the request.
Experimentally I composed the same request message text being sent by ::http::geturl and sent it over wlan0 using nc
; it was sent as a single packet and was successfully processed by the ESP8266.
Does anyone happen to know why sending the request using ::http over wlan0 is ending up with this split message, and what if anything can be done to prevent it?
Code fragment:
...ANSWER
Answered 2020-Dec-13 at 22:32Tcl's http package flushes the headers to the socket (i.e., performs an actual write()
/send()
) between writing the headers and the body of a query. For any correct implementation of an HTTP server this is fine… but you're not working with that. For some reason, the wlan and eth drivers in the OS kernel have different policies for what to do with that case, with the eth driver deciding to wait a bit before sending; Tcl definitely doesn't configure this aspect of sockets at all, staying with the system defaults. (I don't know how to configure the OS defaults.)
You can always take a copy of the http code and comment out the flush
. It's this one:
https://core.tcl-lang.org/tcl/artifact/d9f8dc4bd7211a37?ln=1463
line 1463:
flush $sock
There's a Download
button/link at the top of the page for that exact version of that file (it's changed only very slightly from the one in your version of Tcl and should be compatible provided you source
the file explicitly before doing any package require
calls).
QUESTION
I'm attempting to write to an LCD (LCD1602 Display Screen) using a PCF8574 IO Expansion Board. I've used some example code I found, but although it does flash the background light (so I know it is communicating with the LCD) it doesn't print numbers.
I don't want to use the WiringPI library because it is no longer supported and I want to use the BCM2835 libraries. Anyone know how I can write characters to the LCD? I thought I only needed to send the ascii codes?
...ANSWER
Answered 2020-Nov-26 at 22:30Rather than doing all the work directly through bcm2835 I discovered a library for speaking to an lcd screen via i2c.
https://github.com/albertherd/LCD1602
If you did want to do this solely through bcm2835 then it looks like you just need to do some file IO operations for the I2C controller on the PI. (easier to use the library)
QUESTION
I found the only one Python library for the Digital-output relative humidity & temperature sensor/module DHT22: https://github.com/adafruit/DHT-sensor-library
But considering a function in /usr/local/lib/python3.7/dist-packages/Adafruit_DHT/platform_detect.py it's not supporting the latest Raspberry processor (BCM2711):
...ANSWER
Answered 2020-Jul-22 at 13:34I dared to change the above function and it works! But BE CAREFUL if you use outputs that are different for different board versions. I used GPIO4.
QUESTION
I'm using the library bcm2835 1, it works, I can see on the terminal how plots 126 data information from a sensor but from that point on I recieve this:
...ANSWER
Answered 2020-Jul-25 at 07:46As one of the comments said the problem here was that I was initializinf the SPI every iteration, I had to put it outside the for loop.
QUESTION
ANSWER
Answered 2020-Jun-30 at 19:39For future reference, see the helpful discussion here on GitHub.
QUESTION
Im a C noob, Ive this code which is supposed to measure body temperature using IR sensor on raspberry pi. The code is working fine but it doesn't work in loop mode and simply prints the temperature only once and exits. While I want it to run continuously until user presses some interrupt key/killed by user.
...ANSWER
Answered 2020-Jun-30 at 13:46You need an infinite loop. For example:
QUESTION
I am currently working on a program where I need to store big integer values, big enough that they don't fit into uint32
. Only int64
or uint64
.
I just realized the Raspberry Pi Zero v1.3
, that I will be using for this project, has Broadcom BCM2835 processor
, which I believe is a 32 bit
architecture processor.
It contains an ARM1176JZFS (ARM11 using an ARMv6-architecture core) with floating point, running at 1GHz
How do I ensure my program functions correctly on this 32 bit architecture? Do I have to do anything differently? Or does the compiler is able to handle this without a problem when I cross compile it: env GOOS=linux GOARCH=arm GOARM=6 go build
?
ANSWER
Answered 2020-Jun-26 at 13:45First, the disclaimer: I don't write 32-bit code, so what I say may be incomplete.
According to the language spec, the only architecture dependent types are int, uint, and uintptr. That means, you have to go back and check every piece of data and function argument declared as one of these types. You also have to check any untyped numeric literal (declared constants and literal values) passes as interface{}, because those will be passed as int as well.
QUESTION
I'm trying to show a bootscreen during the boot of my Yocto-build distribution. This runs on a Compute Module 3+ (CM3+). Here's what I figured out so far:
- Compile u-boot with
CONFIG_CMD_BMP=y
andCONFIG_DM_VIDEO=y
- Place a bitmap image on the boot partition and load it with
fatload mmc 0:1 $loadaddr /splash.bmp
- Check that the bitmap was loaded correctly:
ANSWER
Answered 2020-May-21 at 08:56Turns out I had a bitmap with 24 bit, so I also needed to define CONFIG_BMP_24BPP
so the relevant support code is compiled-in (see here). Better error handling code would have been great here. :)
QUESTION
Before I write down my problem let me say that I have literally visited all relevant pages on internet regarding RPi4B, SPI, BMI088, bcm2835 library and C, with no luck and a lot of frustration.
I have 6 BMI088 sensors I'd like to connect to RPi4B over SPI. On Arduino it works perfectly (one or all 6) with Bolder Flight library. The problem is I don't get anything from sensor when I connect it to RPi. Connections are ok (3.3 V, GND, MISO, MOSI, SCK, CS, PS to ground (only BMI088)). I also have a switch to turn sensor power ON/OFF. I am sending exactly the same messages as Arduino library does, but I get nothing from the sensor, MISO is silent. I provide a rising edge to CSB1 pin as stated in datasheet. If I connect MISO and MOSI RPi receives data.
How do I get BMI088 to talk to RPi over SPI?
The code (not whole, just relevant part):
...ANSWER
Answered 2020-May-12 at 15:21I know where was the problem. Apparently in order to send correct bytes to the sensor (using SPI) you have to use bit mask for some addresses. This is NOT specified in the BMI088 datasheet. I found that out after I checked what Arduino is sending to the sensor with the logic analyzer and I also took a look at BMI088 Arduino library. Now I get the correct data.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bcm2835
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page