What to do when you just don't know :: Arduino, ADXL345 triple axis accelerometer and an RGB LED

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 14

  • @programmingelectronics
    @programmingelectronics  4 роки тому +1

    ****If you like this, I think you'll like the premium Arduino training we offer. You can check it out here**** bit.ly/3lHyzcB

  • @naboulsikhalid7763
    @naboulsikhalid7763 Рік тому

    sure it's helpful and more. this is the situation I am confronting most of the time, and when I see that I don't understand all the code, I abandon it. So, from now on, I will explore what fit me in any code I encounter and use it diligently. thank you for wakening me up😉

  • @malgailany
    @malgailany 10 років тому +1

    Nice and interesting!
    If we take one axis of the three axes, for instance the X-axis, then a zero value is for the horizontal position. A negative value (-1 to - 128) may represent a counter clockwise position and a positive value (+1 to +127) may represent a clockwise position. the same is true for the Y and Z axes. Notice that (-128 to +127) is 255.
    Thank you

  • @beehive808
    @beehive808 10 років тому +2

    Thanks for the great videos

  • @kanabalize
    @kanabalize 10 років тому +1

    Damn i had the same idea before...
    Maybe we can put in a code that detects the max and min values of the X,Y,Z ranges.
    Then map the values to make the mapping is tight

  • @bennguyen1313
    @bennguyen1313 7 років тому +1

    Very nice production value on the video!
    Any plans on visualizing the sensor output using Unity? I've seen some projects that do it, but I ''just dont' know' enough to implement it myself correctly! This is my code:
    void SetPosByAngle ( float fPitch, float fRoll )
    {
    Vector3 LowerLimit = new Vector3(0, 0, 0);
    Vector3 UpperLimit = new Vector3(180, 180, 180);
    // Normalize from -180/+180 to -1/+1
    fPitch = (fPitch) / 180.0f;
    fRoll = (fRoll) / 180.0f;
    Vector3 AngleDiff = UpperLimit - LowerLimit;
    Vector3 CalculatedAngle = new Vector3(-fPitch * AngleDiff.y, 0, -fRoll * AngleDiff.x);
    TragetAngle = LowerLimit + CalculatedAngle;
    transform.localEulerAngles = TragetAngle;
    }
    Where the angles sent to the function above are calculated via:
    fPitch = (float) (Math.Atan2(YAxisAccelerationData,ZAxisAccelerationData)+M_PI)*RAD_TO_DEG;
    fRoll = (float) (Math.Atan2(ZAxisAccelerationData, XAxisAccelerationData)+M_PI)*RAD_TO_DEG;
    Unfortunately, my object moves across the screen, rather than pitching/tilting at the center of the screen. Apparently the solution to drift is to project a reference frame, but would love to see a how-to!
    gamedev.stackexchange.com/questions/140141/unity-3d-recreation-of-pitch-roll-from-accelerometer
    answers.unity3d.com/questions/416169/finding-pitchrollyaw-from-quaternions.html
    forum.unity3d.com/threads/roll-pitch-and-yaw-from-quaternion.63498/

  • @tahirashabbir2392
    @tahirashabbir2392 8 років тому +1

    How can we connect two accelerometer at the same time with arduino ?

  • @tanzeelsalfi
    @tanzeelsalfi 6 років тому +1

    Thanks

  • @sultansrv
    @sultansrv 7 років тому

    Hello, im having trouble controlling the direction and speed of servo motors using the output values from this accelerometer, any suggestions ?

  • @alexisknipping2360
    @alexisknipping2360 8 років тому

    Can you use this with a different accelerometer? If I have ADXL335 would the libraries still work etc?

  • @aksharasri8070
    @aksharasri8070 7 років тому

    can you please suggest some other projects with adxl345

  • @maskedrider5721
    @maskedrider5721 7 років тому

    how to make a vibration velocity measurement using adxl345 ?
    please, help me

  • @preshitapabari1333
    @preshitapabari1333 7 років тому

    instead of the triple accle accelrometere you could name the video how to make use of arduino software

  • @snaprollinpitts
    @snaprollinpitts 9 років тому +1

    Hi Michael, if you need to reflow a board try a heat gun, you got a cute kid too. mike