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); )...
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...
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...
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 ...
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...
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...
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...
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...
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,...
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 ...
[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...
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...
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...
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...
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....
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 ?
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...
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...
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...
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...
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 ...
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...
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...