reading raw data of MPU-9150 break board with Arduino micro - arduino

We are trying to connect the MPU-9150 break board to arduino micro and we have used the example code suggested in the sparkfun document (https://github.com/sparkfun/MPU-9150_Breakout/tree/master/firmware) to read the raw data. Our Vcc is always 3.3V. And our Baud rate is 9600. Here is what serial port monitor shows. all 9DOF values are zero
a/g/m: 0 0 0 0 0 0 0 0 0
a/g/m: 0 0 0 0 0 0 0 0 0
a/g/m: 0 0 0 0 0 0 0 0 0
a/g/m: 0 0 0 0 0 0 0 0 0
a/g/m: 0 0 0 0 0 0 0 0 0 …
When we use the code suggested in Arduino playground: http://playground.arduino.cc//Main/MPU-9150 Here is what we get. Now all values are -1
-1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
36.50 -1 -1 -1 -1 -1 -1 -1 -1 -1
........
We are also pretty sure about the connections. We really have no idea where we are doing wrong. Vcc, GND, SCL and SDA are all connected. any comment would be appreciated.

I am having the exact same problem with the second code you mention (-1 -1 -1 ....)
I had other errors with the first one and couldn't get it working at all. (I'm very new to arduino programming so almost 100% certain it will be something I'm doing wrong).
However I did get older code related to your first example working as follows:
[Using arduino uno connected gnd-gnd, vcc-3.3v, sda-A4 and scl-A5]
Download zip file from: https://github.com/sparkfun/MPU-9150_Breakout
(zip file is on right hand side)
Unzip, copy folders I2Cdev & MPU6150 into C:.../users/.../documents/arduino/libraries/
(or similar as appropriate where libraries are kept)
Run Arduino
Open the program: MPU9150_raw and upload
(it's found in MPU6150\examples\MPU9150_raw)
Open the Serial Monitor
Change baud rate to 36000
hopefully works!
I've recently also gotten the code at playground.arduino.cc//Main/MPU-9150 working with the Arduino Uno and the breakout board. If you are using the sparkfun breakout board I think you need to alter the code in two places to change the I2C address to 0x68 because AD0 on the board is pulled low rather than high. So you would search for int MPU9150_I2C_ADDRESS = 0x69; and change to 0x68 (It mentions this in the code so sorry if this is obvious to most people, just thought I'd post it anyway in case it helps someone else).
On the arduino webpage for the 6050 (I don't have enough reputation to post another link)
it says
"The I2C-address depends on the AD0 pin of the sensor. If it is connected to ground, the >address is 0x68. If it is connected to VLOGIC (+3.3V) it is 0x69. There are a few sensor >boards with the MPU-6050 sensor already soldered on it. Some of those boards have a pull->down resistor at AD0 (address = 0x68), others have a pull-up resistor (address = 0x69)."

Same problem.
Juste change the I2C adress of your device...
Connect, AD0 to GND and cho

i have the mpu9150 also. this code gives me raw values for all three internal chips. double check your baud rates. good luck
https://github.com/sparkfun/MPU-9150_Breakout/blob/master/firmware/MPU6050/Examples/MPU9150_raw/MPU9150_raw.ino

Related

Julia BitArray with 128 Bits

I need a Julia BitArray-like object that can encode more than 64 bits, say 128 bits. Does a simple replacement of UInt64 with UInt128 in bitarray.jl work?
Based on the information in your comment, the existing BitArray would itself serve your needs. Note that BitArray uses UInt64s internally, but that's not a limitation on the size of the array - it actually stores the bits as a Vector of UInt64s, so there's no special size limitation. You can create a 5x5x5 BitArray with no problem.
julia> b = BitArray(undef, 5, 5, 5);
julia> b .= 0;
julia> b[3, 5, 5] = 1
1
julia> b[3, :, :]
5×5 BitMatrix:
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
Maybe this part of the documentation threw you off:
BitArrays pack up to 64 values into every 8 bytes, resulting in an 8x space efficiency over Array{Bool, N} and allowing some
operations to work on 64 values at once.
but that's talking about internal implementation details. BitArrays are not limited to 8 bytes, so they're not limited to having just 64 values in them either.
Creating a new type of bit array using UInt128s would likely not be optimized, and is unnecessary anyway.

Stream cipher LFSR Known-Plaintext

I am currently learning cryptography,
I got different tasks. The current one features stream ciphers based on LFSR which can be solved with the Gaussian algorithm.
The cipher is: 0001 0010 01101101
I know that the first 8 bits of plaintext are all 1.
The length of n is 4.
So if I XOR them I get:
11101101
But now I am stuck and don't know how to translate it into a correct matrix.
1 1 1 0 | ?
1 1 0 1 | ?
1 0 1 1 | ?
0 1 1 0 | ?
Is this the correct way or do there only need to be 3 variables in front of the line? And where do I get the solution of the question marks from?
I hope someone can help me understanding cryptography. Thanks.

Multiple responses in SPSS

I have multiple response questions which have 5 categories (values). I want to get respondents who answered only one category.
For example,
Respondents who answered category not 2,3,4,5.
I want only A mentions like, who are all checked A category alone. I need count of this.
Help, Please.
The following solution is assuming the data has 5 dichotomous variables - one for each of the multiple response categories.
* creating some sample data to demonstrate on.
data list list/cat1 to cat5.
begin data
1 0 0 0 1
0 1 1 0 0
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 0 1
1 0 0 0 0
1 1 1 0 0
end data.
* now checking in which cases only category 1 was chosen.
compute NumCats=sum(cat1 to cat5).
if cat1=1 and NumCats=1 onlyCat1=1.
execute.
* if instead you wish to do the same check for each of the 5 categories,
use `do repeat` this way.
do repeat cat=cat1 to cat5/only=only1 to only5.
compute only=(cat=1 and NumCats=1).
end repeat.
execute.
But ditch the EXECUTE commands. They just cause a useless data pass in this case except for immediately updating the Data Editor (instead of updating on the next data pass).

UFF58 File reader using R Program

I have a input uff file with 'n' no.of channels. I want to read the UFF file and also split the values based on each individual channel. Then store the result for each channel in separate file. Each channel always start with '-1' '58' etc., and end with '-1'.
Example channel_01 from the input UFF file:
-1
58
filename
22-Mar-2016 10:16:53
164
MnBrgFr-AC225R/N;50.9683995923 mV/m/s2
0 0 0 0 channel_01 0 0 NONE 0 0
2 1048576 1 0.00000E+00 8.19669930804e-06 0.00000E+00
17 0 0 0 Time s
1 0 0 0 MnBrgFr-AC225R/N m/s2
0 0 0 0 NONE NONE
0 0 0 0 NONE NONE
392.665124452 392.659048025 392.658404832 392.661676933 392.665882251 392.671989083
392.67634175 392.673743248 392.672398388 392.669360175 392.665533757 392.66088639
392.660390546 392.660975268 392.663400693 392.662668621 392.661209156 392.65498538
392.649463269 392.649580214 392.649259786 392.658580248 392.664715147 392.667051694
-1

What is the correct name of this error correction method (it is similar to Hamming Code)

What is the correct name of this error correction method?
It is quite similar to Hamming Code, but much more simple. I also cannot find it in the literature any more. The only internet sources, I'm now able to find, which describes the method, are this:
http://www.mathcs.emory.edu/~cheung/Courses/455/Syllabus/2-physical/errors-Hamming.html
And the german-language Wikipedia.
http://de.wikipedia.org/w/index.php?title=Fehlerkorrekturverfahren
In the Wikipedia article, the method is called Hamming-ECC method. But I'm not 100% sure, this is correct.
Here is an example, which describes the way the method works.
Payload: 10011010
Step 1: Determine parity bit positions. Bits, which are powers of 2 (1, 2, 4, 8, 16, etc.) are parity bits:
Position: 1 2 3 4 5 6 7 8 9 10 11 12
Data to be transmitted: ? ? 1 ? 0 0 1 ? 1 0 1 0
Step 2: Calculate parity bit values. Each bit position in the transmission is assigned to a position number. In this example, the position number is a 4-digit number, because we have 4 parity bits. Calculate XOR of the values of those positions (in 4-digit format), where the payload is a 1 bit in the transmission:
0011 Position 3
0111 Position 7
1001 Position 9
XOR 1011 Position 11
--------------------
0110 = parity bit values
Step 3: Insert parity bit values into the transmission:
Position: 1 2 3 4 5 6 7 8 9 10 11 12
Data to be transmitted: 0 1 1 1 0 0 1 0 1 0 1 0
Is is quite simple to verify, if a received message was transmitted correctly and single-bit errors can be corrected. Here is an example. The receiver calulates XOR of the calculated and received payload bits where the value is a 1 bit. Is the result is 0, there the transmission is error-free. Otherwise the result contains the position of the bit with the wrong value.
Received message: 0001101100101101
Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Received data: 0 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1
Parity bits: X X X X X
00101 Position 5
00111 Position 7
01011 Position 11
01101 Position 13
XOR 01110 Position 14
--------------------
01010 Parity bits calculated
XOR 00111 Parity bits received
--------------------
01101 => Bit 13 ist defective!
I hope, anybody here knows the correct name of the method.
Thanks for any help.
This looks like a complicated implementation of the Hamming(15,11) encoding & decoding algorithm.
Interleaving the parity bits with the information bits does not change the behaviour (or performance) of the code. Your description only uses 8 information bits, where the Hamming(15,11) corrects all single bit errors even with 11 information bits being transmitted.
Your description does not explain how the transmitted 12-bit message gets extended to a 16-bit message on the receive side.

Resources