void Senser_reading()
{
int downfront_temp=0,downleft_temp=0,downright_temp=0;
int upfront_temp=0,upleft_temp=0,upright_temp=0;
int balance_temp=0,balance_right_temp=0;
int loop;
for(loop=0;loop<100;loop++)
{
if(IORD_ALTERA_AVALON_PIO_DATA(DOWNFRONT_BASE))
downfront_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(DOWNLEFT_BASE))
downleft_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(DOWNRIGHT_BASE))
downright_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(UPFRONT_BASE))
upfront_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(UPLEFT_BASE))
upleft_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(UPRIGHT_BASE))
upright_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(BALANCE_BASE))
balance_temp++;
if(IORD_ALTERA_AVALON_PIO_DATA(BALANCE_RIGHT_BASE))
balance_right_temp++;
}
switch(downfront_temp)
1