Auto level off-road buggy, First Arduino project

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Auto level off-road buggy, First Arduino project

Post by adafruit_support_bill »

so i could use one of those chips (the 732 bigger is better) and 16 of the MOSFETs and build my own 16 port i2c MOSFET board ?
Sure!
Is there any reason I couldn't put a led in parallel with the gate of each MOSFET
That should work too.

Wkoffroad
 
Posts: 22
Joined: Fri Feb 14, 2014 11:52 am

Re: Auto level off-road buggy, First Arduino project

Post by Wkoffroad »

I drew up a board for my i2c MOSFET thing today but it won't let me share the picture , also my filter and auto/ manual switch ( while statement ) do not work , I thought they did but I was mistaken the last code I posted is what I have working so I am needing more info on filtering the signal .

I am very grateful for the help I am getting from this site

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Auto level off-road buggy, First Arduino project

Post by adafruit_support_bill »

The autoregressive filter by jcgoodman is a good one. I'd go with that.

Code: Select all

int filterstrength = 10;  // Roughly how many samples contribute to the filtered output.  Bigger = smoother
filteredpitch = ((filterstrength -1)* filteredpitch + orientation.pitch) / filterstrength;
filteredroll = ((filterstrength -1)* filteredroll + orientation.pitch) / filterstrength;

Wkoffroad
 
Posts: 22
Joined: Fri Feb 14, 2014 11:52 am

Re: Auto level off-road buggy, First Arduino project

Post by Wkoffroad »

the way i have it coded the filter strength is directly changing the angle of the reaction and doing nothing to the shock,and i have just realized i am using the accel only and when i try the gyro test code it says it is not wired correctly.

Wkoffroad
 
Posts: 22
Joined: Fri Feb 14, 2014 11:52 am

Re: Auto level off-road buggy, First Arduino project

Post by Wkoffroad »

so i defined my filtedpitch and filteredroll as a float :?: and it is working now , woohoo

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Auto level off-road buggy, First Arduino project

Post by adafruit_support_bill »

so i defined my filtedpitch and filteredroll as a float :?: and it is working now
It is easy to overflow these variables with a large "filterstrength". A float gives you a lot more headroom.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”