Go to advanced search

by Grozhibou
Mon Jul 24, 2017 1:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C : receive a whole string with C and WiringPi
Replies: 0
Views: 529

I2C : receive a whole string with C and WiringPi

Hi, I'm trying to send a string from an Arduino Uno to a RPi 3 using I2C. At the moment, I manage to send a char to the Pi with Wire.write("A"); on the Arduino, and to receive and display it with printf("%c\n", wiringPiI2CRead(fd)); ( fd being the returned value of wiringPiI2CSetup(SLAVE_ADDRESS); )...
by Grozhibou
Mon May 22, 2017 1:40 pm
Forum: C/C++
Topic: WiringPi : change interrupt polarity on same pin
Replies: 2
Views: 701

Re: WiringPi : change interrupt polarity on same pin

Use both edges, rather than switch between rising and falling? It's the second time that I'm told to do that, I'm angry that I forgot the first time..! :( I now have a single interrupt function which contains two if : if digitalRead(pin) == HIGH and LOW : it works the way I want. Many thanks for yo...
by Grozhibou
Mon May 22, 2017 8:38 am
Forum: C/C++
Topic: WiringPi : change interrupt polarity on same pin
Replies: 2
Views: 701

WiringPi : change interrupt polarity on same pin

Hi, I'm reading a periodic signal coming from an Arduino with a RPi 3, using a software written in C with the WiringPi library. I want to trigger two actions : one on a rising edge, an another one on a falling edge, to measure the elapsed time between the edges. To do so, I do the following : #inclu...
by Grozhibou
Tue Apr 18, 2017 1:27 pm
Forum: C/C++
Topic: Measure pulse width with WiringPi
Replies: 5
Views: 1880

Re: Measure pulse width with WiringPi

You are trying to do something on a system that will interrupt your program at random. Your program will always over estimate the timing. The system also has dynamic RAM which will be refreshed by the hardware - that will stop your program running. Similarly for the video refresh. I'm aware that a ...
by Grozhibou
Tue Apr 18, 2017 11:36 am
Forum: C/C++
Topic: Measure pulse width with WiringPi
Replies: 5
Views: 1880

Re: Measure pulse width with WiringPi

You probably need to be using both edges. INT_EDGE_BOTH raises an interrupt for both rising and falling signal, so I assume I'd have to create a single function changeState to call. Then, what to do in this function ? I was thinking about something like if (digitalRead(pin) == 1) pulseRising(); els...
by Grozhibou
Tue Apr 18, 2017 8:33 am
Forum: C/C++
Topic: Measure pulse width with WiringPi
Replies: 5
Views: 1880

Measure pulse width with WiringPi

Hello, With a RPi 3, I'm trying to measure the width of a short pulse (about 125 µs) with the WiringPi C library. For the moment, I want to get the current time in microseconds on the rising edge, and then the current time in microseconds on the falling edge. The width of the pulse should be time at...
by Grozhibou
Fri Mar 31, 2017 7:24 am
Forum: Automation, sensing and robotics
Topic: Issues getting heading from magnetometer
Replies: 2
Views: 733

Re: Issues getting heading from magnetometer

if you look at the datasheet you see that the magnetometer is orientated differently than it is on the LSDM9DS0 Yes, and it isn't even orientated in the same way as the gyro and accelero... I'll have a look at the LSM9DS0 datasheet to compare the axis with the LSM9DS1's, and I'll apply the needed c...
by Grozhibou
Tue Mar 28, 2017 9:10 am
Forum: Automation, sensing and robotics
Topic: Issues getting heading from magnetometer
Replies: 2
Views: 733

Issues getting heading from magnetometer

Hi, I'm on a RPi 3, working in C++ on a Sense HAT, equipped with an LSM9DS1 gyro/accelero/magnetometer. I'm trying to get the current heading of the RPi in degrees, so I followed this tutorial , designed for the LSM9DS0 that I adapted for my needs. Problem is I don't manage to get the same raw value...
by Grozhibou
Wed Mar 01, 2017 10:08 am
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

Restarting from zero to understand what I do, I have the following short Python 3 code to get raw acceleration values : import smbus # /dev/i2c-1 bus = smbus.SMBus(1) # Leaving ODR power-down mode to 476 Hz. bus.write_word_data(0x6a, 0x20, 0xa0) while True: print("X: " + str(bus.read_word_data(0x6a,...
by Grozhibou
Thu Feb 23, 2017 9:44 am
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

The classic thought experiment is to consider a stone tied to a string, being spun in a circle. What forces are acting? Obviously gravity, but not particularly relevant to the motion of the stone (first approximation :D) Around the circumference of the circle? Basically nothing, because the string ...
by Grozhibou
Wed Feb 22, 2017 2:50 pm
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

[Yes, constant but non-zero. You are measuring the centripetal acceleration that keeps the Pi moving in a circle rather than a straight line. When the angular velocity changes then the y-axis acceleration will also be non-zero until a new steady speed is reached. Ok, I see, thanks for the explanati...
by Grozhibou
Wed Feb 22, 2017 1:50 pm
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

It's my first time using I2C and the registers, so thank you for the explanations ! I took your code and "translated" it for the LSM9DS1, thanks to its datasheet and the LSM9DS0 one, and I left to the default values the things I wasn't sure about, and close values when yours weren't possible. For ex...
by Grozhibou
Wed Feb 22, 2017 12:44 pm
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

those raw values dont look correct. I merged my code into your code, i am using the LSM9DS0 it has different registers but the math is the same. The below code works for me. I removed all the accelerometer values as you are looking for the Z gyro rotation. There is no calibration, but you should be...
by Grozhibou
Wed Feb 22, 2017 8:01 am
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

Thank you for your answers. :) you will get a constant 1g magnitude Z acceleration (+ or -). The X and Y values will be varying sinusoidally, in quadrature, at the rotation frequency (0.25Hz). The accelerometer does not read rotational acceleration, but linear. I agree with the +/- 1 g for the verti...
by Grozhibou
Tue Feb 21, 2017 7:32 am
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

Thanks for your answer ! Rounded values are indeed closer to what I was expecting, but I still have an issue : I put my RPi + Sense HAT on a rotating platform which is rotating at 90 dps (+/- 1 dps). I record the X, Y, and Z values, expecting values around 0 dps for X and Y, and around 90 dps for Z....
by Grozhibou
Mon Feb 20, 2017 1:19 pm
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Re: Issues with accelero and gyro sensitivity

I followed these instructions in the "CALIBRATION" section, and obtained an .ini file that I copied in /etc, then I slightly modified it to match my needs : +/- 2 g range for the accelerometer, +/- 250 dps range for the gyroscope.

What about now ? Do I need to import this file in my .py file ?
by Grozhibou
Mon Feb 20, 2017 10:43 am
Forum: Astro Pi
Topic: Issues with accelero and gyro sensitivity
Replies: 17
Views: 7373

Issues with accelero and gyro sensitivity

Hi, I am working on a project to record acceleration and rotation values of a moving object around a vertical axis. The Sense HAT is equipped with an LSM9DS1 inertial module, and its datasheet states that it has various measurement ranges, each range having its own sensitivity. For the moment, I'm o...
by Grozhibou
Mon Mar 09, 2015 8:05 am
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

Quand je dis que je me suis trompé dans mes calculs, c'est rapport à l'intensité que je réclamais (20 mA) qui est hors-limite du RPi (16 mA). Après je suis bien sûr d'accord pour dire qu'il n'y a pas vraiment de "bonne valeur", mais une "plage de bonnes valeurs". nikotinux, j'en profite pour te dire...
by Grozhibou
Fri Mar 06, 2015 8:27 am
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

It's me again ! Just to tell you I did the maths with both an engineering student and a physics teacher, and they all agree with using a 150 ohms resistor ;) The maths I did before was wrong because I used the 20 mA of the LED instead of the 16 mA max of the RPi, which is also not really wrong becau...
by Grozhibou
Tue Mar 03, 2015 7:45 am
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

Thank you very much !

// Merci beaucoup !
by Grozhibou
Mon Mar 02, 2015 2:40 pm
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

http://www.raspberrypi.org/documentation/hardware/raspberrypi/gpio/README.md This link is great, thank you ! It leads me to one final question : as there is a maximum voltage GPIOs can bear (which is 3.3 V), is there a maximum current GPIOs can sustain ? // Dernière question : il y a une tension ma...
by Grozhibou
Mon Mar 02, 2015 2:04 pm
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

If you use the special purpose pins as normal GPIOs you can get surprises.
I only intend to use the 17 GPIO pins that are not related to anything, in green according to this chart. Is it okay ?

How many amperes does each of these 17 GPIO deliver ?
by Grozhibou
Mon Mar 02, 2015 1:13 pm
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

I have just found this calculator which returns 75 ohms as I calculated : http://ledcalc.com/ . I am therefore reassured about what I did :) I assume using a resistor of higher resistance would result in a LED flashing less. MOSI, MISO, SCLK, CE/CS/SS == SPI SDA, SDL, SCL == I2C Wow, that is pretty ...
by Grozhibou
Mon Mar 02, 2015 11:30 am
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

560 ohms Quel calcul avez-vous fait pour obtenir ce résultat ? http://pi.gadgetoid.com/pinout MOSI ? SCLK ? PCM Data Out ? PCM Data In ? Je m'embrouille de plus en plus au fil de mes recherches... :( Est-ce que je peux utiliser la GPIO 21 (pin 40) en sortie pour allumer une DEL, et fermer mon circu...
by Grozhibou
Mon Mar 02, 2015 8:37 am
Forum: Français
Topic: Quelles sont les GPIO utilisables du RPi B+ ?
Replies: 19
Views: 11052

Re: Quelles sont les GPIO utilisables du RPi B+ ?

Bonjour, Tout d'abord, je suis conscient de poster dans un vieeeux sujet datant d'août, mais mes questions sont parfaitement dans le thème et la continuité de ce sujet, donc je me suis dit que je n'allais pas ajouter un nouveau sujet. Bref, j'ai donc trois questions à vous poser : - Je lis souvent q...

Go to advanced search