Hi im doing a project that moves a robot around a maze avoiding walls and need some help with converting C code into assembly code.
#include <stdio.h>
int left_feeler;
int right_feeler
int left_speed;
in right_speed;
void main ()
{
While (1)
{
printf(" left feeler=");
scanf( "%d/n", &left_feeler);
printf(" right feeler=");
scanf( "%d", &right_feeler);
if (( left_feeler ==0) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 0 ;
}
if (( left_feeler ==0) && ( right_feeler ==1))
{
left_speed = 0 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==1))
{
left_speed = 10 ;
right_speed = 0 ;
}
printf("right speed = %d \n", right_speed) ;
printf("left speed = %d \n", left_speed) ;
#include <stdio.h>
int left_feeler;
int right_feeler
int left_speed;
in right_speed;
void main ()
{
While (1)
{
printf(" left feeler=");
scanf( "%d/n", &left_feeler);
printf(" right feeler=");
scanf( "%d", &right_feeler);
if (( left_feeler ==0) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 0 ;
}
if (( left_feeler ==0) && ( right_feeler ==1))
{
left_speed = 0 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==1))
{
left_speed = 10 ;
right_speed = 0 ;
}
printf("right speed = %d \n", right_speed) ;
printf("left speed = %d \n", left_speed) ;