Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #4159

    Hi again. I have a few problems:

    1) Unlike the other codes, why do I always have to CD into the library when running these executables:
    a) pi@raspberry~$ sudo./gyro_accelerometer_tutorial02
    b) pi@raspberry~$ sudo./compass_tutorial03

    Only these two tutorials don’t execute without having to CD.. while others work perfectly fine even if i type the executable straight after “pi@raspberrypi~$

    2) Calibration Questions

    a) Step 3 says “Stop the program with ‘Ctrl-C’ and you will see some definitions printed out in blue text which needs to be added to your compass program. E.g. compass_tutorial03.c in the above Git repository”

    –> I was able to get the definitions in blue text (pls see image). What do I do next? By “adding the values to compass program” means I have to replace the values below to the ones I got? Or do i simply just type the values i got under it? Pls help me understand.

    `#define magXmax 1210
    #define magYmax 1245
    #define magZmax 1178
    #define magXmin -1335
    #define magYmin -1142
    #define magZmin -1303

    b) Could you pls check if my “rawdatauncalibrated.txt” file has the right contents? (see image)

    c) The first two steps of plotting…

    Do i type it like this:
    pi@raspberrypi ~ $ sudo ./compass_tutorial01 > rawdatauncalibrated.txt
    pi@raspberrypi ~ $ awk ‘NR>2{ print l} {l=$0}’ calnewtemp.txt > ~/uncalibrated.txt

    Or like this:
    pi@raspberrypi ~ $ sudo ./compass_tutorial01 > rawdatauncalibrated.txt
    awk ‘NR>2{ print l} {l=$0}’ calnewtemp.txt > ~/uncalibrated.txt

    3) How can I rotate the compass display by 90 degrees … i’m using an led tv so it’s displaying in landscape orientation, how can i make it portrait.

    Thanks a lot.


    Yes, i did and it worked. Sorry for the stupid mistake 🙂

    Altho i have another question regarding the Plotting of Uncalibrated Output using Mathematica.

    In the guide it said “You will want to pipe the output to a file, which we will use for Mathematica.”
    From what I understand, i should run sudo ./compass_tutorial01(uncalibrated compass) – copy the outputand save it as “rawdatauncalibrated.txt”

    I have done that and saved the txt file in home/pi folder. But when i type: pi@raspberrypi ~ $ sudo compass_tutorial01 > rawdatauncalibrated.txt it is telling command not found. (see image)



    I’m trying the new codes for “compass with tilt compensation” and was able to compile.. but after that no output was being shown?

    What do i type next to run it? thanks.
    Please see image attached.



    I’ve already entered the correct directory, and when i tried to compile (referencing from the README file), I’m getting multiple errors regarding the file gyro_acclerometer_tutorial02_inclinometer.c. Please see image attached.



    Thanks, I have succesfully interfaced the gyro with accelero.. complete with readings 🙂

    I have now moved to the Inclinometer tutorial and have experienced an error again.

    I have successfully installed SDL by typing –> [pi@raspberrypi ~ $ sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libi2c-dev]

    Then, I tried to complile by typing –> [pi@raspberrypi ~ $ gcc -o test test.c sdl-config –cflags sdl-config –libs] Its giving me multiple errors. Please see image attached.

    Am i right to assume that this is because i should type gyro_acclerometer_tutorial02.c instead of test.c?
    Because when i checked the codes, i didn’t find any “test.c” file in any of the folders. What should I do?



    Please bear with me.

    When i type “cd BerryIMU/gyro_accelerometer_tutorial01” it gives me an error that says

    “bash: cd: BerryIMU/gyro_accelerometer_tutorial01: No such file or directory”

    what could be the cause of this problem? Note: all of the codes are located in home/pi

    Although I’ve noticed that the tutorial codes are in “.c” format.. is the error connected to this?



    Yes, i did. I was able to get the addresses 🙂

    My concern now is the next step which says:

    — First, you need to open the I2C bus device file, as follows;

    char filename[20];
    sprintf(filename, “/dev/i2c-%d”, 1);
    file = open(filename, O_RDWR);
    if (file<0) {
    printf(“Unable to open I2C bus!”);

    How do I exactly do this? shall i type it on lxterminal? or make file. and the codes are “C”.. so is there a need to install cmake? Please help me understand, thank you.

Viewing 7 posts - 1 through 7 (of 7 total)

Blip, blop, bloop…