Author Topic: (stampy_sumo_source_code)  (Read 837 times)

0 Members and 1 Guest are viewing this topic.

Offline lucasromeiroTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
(stampy_sumo_source_code)
« on: March 29, 2010, 06:56:32 PM »
hello, I'm d Brazil. I saw the code so sumo (stampy_sumo_source_code) downloaded the file and looked at the controls and had a lot of trouble understanding, someone could guide me, to give some tips, because I need the code of the sensor to the scan complete (radar) could not only use part of the radar, I need it because I am doing a project that needs something like this ... help me? you do for me will be very grateful. Thanks

link: http://www.societyofrobots.com/downloads/stampy_sumo_source_code.zip
« Last Edit: March 29, 2010, 07:06:47 PM by lucasromeiro »

Offline lucasromeiroTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Re: (stampy_sumo_source_code)
« Reply #1 on: March 30, 2010, 10:19:24 AM »
Muio need this code, remove only part of the scanner! help me .. please.

void scan()
   {
   //swap scan directions
   
   /*psuedocode
   while object is detected
      scan left while object detected
   while object not detected
      scan right until object detected*/
   
   target_distance = analog(A3);//check sensor
   
   if (target_distance > distance_thresh)//object detected
      {
      if (scan_angle>-20) //overflow protection
         scan_angle-=1;//scan left
      }
   else //object not detected
      {
      if (scan_angle<130) //overflow protection
         scan_angle+=1; //scan right
      else //if scanned all the way, this forces it to start over
         scan_angle=-20;
      }
     
   //servo scan code
   output_bit(PIN_D2, 1);//139 center
   long_delay_us(130+scan_angle);
   output_bit(PIN_D2, 0);
     
   //printf("angle: %ld distance: %u\r\n", scan_angle, target_distance);//debug code
   }

????????????????????????????????????????

does not work, do not know if that is ..



HELPPPPPPPPPPPPPPPPPPPPPP

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: (stampy_sumo_source_code)
« Reply #2 on: April 04, 2010, 05:13:14 AM »
Did you read the Stampy tutorial?
http://www.societyofrobots.com/robot_sumo.shtml

I'm not sure how else to explain it . . .

 


Get Your Ad Here

data_list