Wow, awesome job spindrah! Yeah, I know mine is going to be even more work and code because of the gyro, but with the help of this board, avrfreaks, as well as a Mr. Anderson who built nBot, I think I will do well on this project. I'm learning so much just from researching, stuff we didn't cover in my class is becoming so easy to integrate into the code and design. This is why I like labs so much, theres so much you can learn by actually doing it.
~Mike
As for 'MrMikey83', have you considered starting off using simple sensors like this?, you could get it all working and the biggest part of the software proven and tested. Then replace the ground sensors with gyro's later, with minimal software changes required!. It would also extend the scope of your project, by showing how to upgrade and improve the basic design to a more functional one, based on varying conditions (ie, non-flat ground).
So far, I am able to read the accelorometer and have found info on making a filter to combine both accelorometr and gyro.
I am now trying to get the remote control part to work. I have a JR XF421 radio control and the receiver has a PWM output for servos.
I am trying to read the PWM through a normal input pin. Can I do this or must I use interrupts? I have 5 channels on the receiver and only 2 interrupts, thats why I am using normal inputs.
I know I need to use the timer, but I have been having trouble trying to find info on using it. The datasheet is confusing to me and my class textbook is of some help but am still stuck.
I need to know what register the timer1 count is located in. I need to define this, then measure once when the pin goes high and again when it goes low, then find the difference.
~Mike
Spindrah, send me your video by e-mail if it's less than 10Mo or by MSN Messenger (if you have it). I'll put it on internet for you, on the server of a friend.
but if it as a pic the reg is TMR1H and TMR1L (high and low byte of 16bit timer)
you also need to set up the T1CON register
also you have to read the low byte before you read the high byte
and you must write the high byte before you write the lowbyte
this is for the 18fxxx chips and is a must
JFDuval said:
Hello!
Spindrah, send me your video by e-mail if it's less than 10Mo or by MSN Messenger (if you have it). I'll put it on internet for you, on the server of a friend.
Here is my progress on the balance bot. I have built a frame from aluminum stock from Lowes. The gears, motors and wheels are from a local RC hobby store. The batteries will be strapped to a peice of plexiglass on top of the two poles that extend upwards off the bot.
The radio controller I am using as well as the receiver are in the pic. The accelorometr and Gyro are on the small breadboard in front of the controller.