
My project differs with TS. My project require me to build a autonomous mobile robot to balance a full cup of water (cap opened) when it's going up a 30degree slope. Im thinking to use a servomotor to turn a acrylic platform, to adjust its angle whenever the inclination changes.
There're other feature as well. Might discuss them at another thread.

I have already bought ADXL335 from Cytron. Want to ask, do i need to get gryoscope and involve kaiman filter as well? Seen some tutorial at website that claim kaiman filter not necessary, as it's too complicated.

I'm using Pic18f452 and 20Mhz oscillator. And...i got not much knowledge and experience on programming.
But I found out a website. They share their source code. Was thinking to move on from there actually. Then saw this, and worry gyro and kaiman will have to come into the picture. @@
- CODE: SELECT_ALL_CODE
#include <p18f452.h>
#include <adc.h>
#include <stdlib.h>
#include <delays.h>
int result;
int flash;
void main(void)
{
//Set Port B Output & Clear
TRISB = 0x00;
PORTB = 0x00;
//Initialize The A/D Converter
OpenADC( ADC_FOSC_32
& ADC_RIGHT_JUST
& ADC_8ANA_0REF,
ADC_CH0 & ADC_INT_OFF );
while(1)
{
//Flash At The Determined Rate
PORTB = 0x00;
Delay1KTCYx(flash);
PORTB = 0x01;
Delay1KTCYx(flash);
//Get A/D Converted Value
Delay10TCYx(5);
ConvertADC();
while( BusyADC() );
result = ReadADC();
//If Within Normal Range Blink Slowly
if(result > 506 && result < 518)
flash = 200;
//If Slightly Tilted Blink Faster
if(result > 518 && result < 550)
flash = 100;
if(result > 545 && result < 506)
flash = 100;
//If Really Tilted Blank FAST!
if(result >= 550)
flash = 25;
if(result <= 450)
flash = 25;
}
}
Any advice?
