Hi,
About 20 months ago I just bought my first arduino and started playing with it. I never lighted up a single LED in my whole life, I never played with batteries, resistor... I am a "mechanical" guy, graduated in mechanical engineer at UFSC, known as the best university for mechanical engineer at South America according to ENADE (a test that checks universities across several fields). EDIT: just to make clear, this university is not a "paid" university as you have in US, it's a federal university which you can only enter after being good at some exams about maths, science, languages... the best ones get in and nobody has to pay anything cause federal universities in Brazil are completely free for those who can get in. So it's not as US where you can buy your place at good universities.
Of course, in USA you have waaay better universities than in the whole South Americe - but hey, I tried my best where I was living. Having said that you can expect that I am not retard as some of you treat me in this forum. I just said that so you can know you should not judge people without knowing them better, as many of you do here at forum.arduino. I say that cause as soon as I started playing with arduino I always wanted to make a quadcopter, always. I came to this same forum and made lots of questions and at 80% of cases I was made fun of, people didnt believe me cause I was asking so many idiot questions - if there is such a thing.
So a few months ago I finished my quadcopter with arduino and published it at youtube just to share with some friends. In the first days nobody got interested in it and I didnt care, I just posted it so I could share the video with some really close friends. After some days the video got a few views and so far at least 40 people got in touch directly with me by mail to ask about my project. and I am not even counting people commenting in the video. I think what made people like it so much is that I did almost all the code by myself. I refused myself to use premade quadocpter codes, I refused to use PID libraries... I just used the really most basic libraries around and built the entire code by myself. I am not a C programmer, sure, the code can be improved and that's why I am getting in touch with you. I think that the fact that I made almost all the code made it easy to people understand it without needing to study too much external content/libraries.
First, lets take a look at my quadcopter, shall we?
Despite some of you may say, it works. It works perfectly to me. It flyes well, is well calibrated and the algorightm has many "safe features" I included. So far, at least 25 people got in touch to show me their drone flying using my code with just a few changes on their own. I am getting a little worried cause I know my code is not the best one in the world and it may have some flaws. So I decided to come here to ask you if there is any place where I can post this project and ask good will people to take a look at the code and improve it?
The code I am hosting it in the link below and this link is already in the description of the video so anyone can download it:
https://www.sitepor500.com.br/?criacao-site-codigo728
The code of my controller (which is also entirely mine, done without any "copy" from any person) is also below:
https://www.sitepor500.com.br/?criacao-site-codigo984
Would any of you mind help me to check this code and tell if there is any good improvement I could make? I dont mean small improvements like using an unsigned int in place of int... I mean real improvements so people can fly it safe and I can be peace of mind that nobody will get hurt by using my code?
After this quadcopter I posted other videos of drones that I made with styrofoam, wood... I am really in love with this but I would like to be sure this code may not fail and fall over any child's head.