how to connect lsm9ds1 to respeaker using mraa? - python

I am new here, so please be patient with me
I have bought a respeaker device. I wanted to connect a bunch of sensors to it (bme280,lsm9ds1,tsl2561) but it turns out that I can't use the same raspberry pi code with it instead I have to use mraa and upm.
The bme280 worked fine with the upm library but the lsm9ds1 and tsl2561 did not work.
So is there any mraa code for these sensors or I have to write it my self? and if so how can I get started?
note: all these sensors are from adafruit.
Thanks anyway :)

DIY
use the library that I have created https://github.com/omar7altawil/LSM9DS1-I2C

Related

Is a Spotify Connect Speaker able to be controlled by Spotipy?

Okay, so this is kind of a stupid question but I tried to understand it myself and I just got even more confused. I am using the Spotipy library to play music (controlled by my raspberry pi) on my computer using the specific device id. Now I want to implement the same thing but be able to play directly on my Raspberry Pi. I have found something called Raspotify, which allows me to use my rpi as a spotify connect speaker. I wasn't able to find it in the devices list though, and I'm now wondering if it is even possible to control a connect speaker?
If not, are there any other ways to play music using the spotipy api on my rpi? Help is greatly appreciated, I tried figuring it out by myself but I just got even more confused.
I now found the answer myself. You can control Spotify Connect speakers using Spotipy, but for me the Spotify API had some trouble finding the device. It then just started working even though I didn't change anything. So for anyone else wondering, a spotify connect speaker acts like a normal device with device id and everything :)

how to calibrate mpu6050 sensor using python and multiwii serial protocol?

I have multiwii board connected to raspberry pi 3A and I want to calibrate the mpu6050 sensor from raspberry pi using python programming, can anyone help me out on how I can program this, please?
Try to be more specific in you questions for te next times.
But, to calibrate a Gyro you should take a look at this tutorial.. Or if you are a really begginer and wants to learn how to use the sensor, take a look to this.
This and this tutorial are also useful.

Building dummy package using pyCharm

I am writing a GUI for my Raspberry pi, but I'd like to work on the code on PC, then drop it into the pi, just cos the tools are better and I mostly have remote access to the pi etc etc. My problem is that the GUI does some calls to change IO pins on the Pi, using the RPi.GPIO library, which doesn't exist on PC. Of course I can comment out the lines of pi-specific code, but that's really messy especially if I start going back and forth. My idea is to set up a dummy/mirror library for the PC, then the code picks the dummy library on PC and the real library on the pi. Seems simple, but I'm getting really bogged down creating my own library. So, to my question, in summary - what is the easiest way to create a quick library using PyCharm that my code would pick up...
Here is some quick code for context...
import RPi.GPIO as GPIO # this is the library I want to mirror
# sets pin numbering on pi, does completely nothing in
#  the dummy I want to call in on on PC
GPIO.setmode(GPIO.BOARD)
GPIO.output(self.reset_pin, 1) # also does stuff on pi, nothing on PC
There is the fake-rpi package on pypi:
So, does this simulate everything on a Raspberry Pi? No! Right now it simulates what I use and need. Over time, more will be added. You are also welcome to submit pull requests for things I haven't added yet.
But it looks like it simulates GPIO pins

Acessing GPIOs with pypylon

I am using the Basler Racer raL2048-48gm camera and need to access the GPIOS via pypylon API (pylon for python ). I'm used to programming in c ++ version of pylon, there to access a GPIO from a camera you write something like this:
// some code ....
Camera_t Camera (pTl-> CreateDevice (info1));
Camera.UserOutputSelector.SetValue (UserOutputSelector_UserOutput2);
Camera.UserOutputValue.SetValue (true);
// some code ....
I didn't find anything in the pypylon API that would allow me to access the camera's GPIOS ... Does anyone know how to do this?
I solved the problem. I was not calling camera.open() before trying to access the camera parameters. More info.
Thanks everyone that tried answer this question.

Python Wifi Issue Connect to Mysterious Camera

I have been working with some drones and robotics projects using arduino and python. There was a kickstarter project for a neat little hex copter, that hasn't been managed well.
I was lucky, i got my copter and then some time later after some frustrated email exchanges, i finally recieved the camera as well. To this day, their forum has people still complaining. Their maker forum is now down and their wiki hasn't been updated with any specifics on the camera.
http://www.flexbot.cc/wiki/index.php?title=Main_Page#Hardware
Their app to accompany the drone still doesn't support the camera module. Not that it'd matter, as their code isn't very well documented or annotated.
https://github.com/HexAirbot
There are some tips on switching the camera on the comments page of their kickstarter campaign.
https://www.kickstarter.com/projects/1387330585/hex-a-copter-that-anyone-can-fly/posts/1093716
So, sob story over, i'm stuck with this neat little wifi camera that i am unsure on how to connect to. I know how to switch it on and it does have a micro-usb port on it.
What library in Python could i use to stream an image from this camera given that it is a wifi camera. If i wanted the video stream as a numpy matrix.
I need to interface with the camera, so i can connect and disconnect.
Then, be able to read images frame by frame with ffmpeg. I have some python modules that can detect and read from a camera, but how can my code ensure that the camera is connected?
Totally stuck. Any help would be appreciated.
Considering you are building for the android platform, you will more than likely need to use some sort of java/python driver/interface, unless you just use java.
Here is an article on java/python, and using python from within java.
Using Python from within Java

Categories

Resources