Author Topic: help with my robot am using flowcode 3  (Read 3849 times)

0 Members and 1 Guest are viewing this topic.

Offline khalchrisTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
help with my robot am using flowcode 3
« on: October 17, 2008, 10:50:30 AM »
am using SRF05 attached to a servo can anyone help me of how to control the servo and the SRF05 and the two wheels moving the robot all at one time....am using pic16f877
how to rotate"control" the servo and while that the sensor reads the distance and at the  same time controls the motors that drives the robot to avoid walls or move in any direction....i have a code brought from some friend that interfaces the SRF05 and measures a variable distance...but then what to do ,,i need to keep moving the servo and while that the sensor keeps measuring the distance and while that it moves and avoids obstacles...
it is a fire fighting robot it also uses a TPA81 thermal sensor and a powder fire extinguisher that opens by a linear solenoid...

ANY SUGGESTIONS OR HELP >>>>>>i need it whatever it is>>>>>

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: help with my robot am using flowcode 3
« Reply #1 on: October 17, 2008, 12:18:53 PM »
I recommend the book "Embedded C Programming and the Microchip PIC".  It will help you understand embedded programming with focus on the PIC.  Very beginner friendly.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: help with my robot am using flowcode 3
« Reply #2 on: October 19, 2008, 05:09:39 AM »
Quote
am using SRF05 attached to a servo can anyone help me of how to control the servo and the SRF05 and the two wheels moving the robot all at one time....am using pic16f877

You didn't search before asking :P
My code for using the PIC16F877 with a scanning servo, some wheels, and SRF05 Devantech Sonar:
http://www.societyofrobots.com/downloads/fuzzy_C_source_code.zip

From this page:
http://www.societyofrobots.com/robot_omni_wheel.shtml

Offline khalchrisTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: help with my robot am using flowcode 3
« Reply #3 on: November 09, 2008, 05:59:45 AM »
thank you both for your replies i have looked at your link but  as arcman said  am very beginner but today i programmed the sensor again using flowcode and i think i am getting to make it work right this time but it seems that my problem is  that ...
am using timer1 with 1:1 prescaler and using a 8 mhz crystal and with  division by 4 ,timer1 will overflow after about 131 milli seconds and that is more than enough for the sensor ???is this right???because it lowers its echo after about 35 milli seconds
i send a trigger pulse to the sensor for at least 10 micro seconds then i start timer1 >>>t1con=0x01
and then i wait for the echo pin to go low so i use a while loop statement "or an if statement" that while echo=1 keep looping and as soon as the echo pulse goes low the  loop is finished and do this >>>t1con=0x00 stop the timer and get timer1H and timer1L bytes values  like this
FCV_TIMER1H=tmr1h; FCV_TIMER1L=tmr1l;  this is how it is done using flowcode
then my question which i still dont know its answer is that after i do this
distance=((TIMER1H<<8)+TIMER1L)/58
the distance defined as an integer will be what in cm's ok but what is its maximum and minmum values and  if i want to compare it would i just say if distance>100 for example let pin b0 high and else let pin b1 high,would that be right or what??also do i have to use timer1 overflow interrupt???
this is the C-code for the srf05 using flowcode,

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: help with my robot am using flowcode 3
« Reply #4 on: November 13, 2008, 02:26:03 AM »
khalchris, I am having trouble understanding your questions. Please break up your sentences and parse them in an easier to understand order.

Also, tell us what isn't working, whose code you used, and what modifications you made to it.

Offline khalchrisTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: help with my robot am using flowcode 3
« Reply #5 on: November 13, 2008, 11:49:24 AM »
can you just tell me what codes starts and stops and resets timer1 in pic16f877 and please dont tell me that it is TMR1ON=0 or TMR1ON=1

 


Get Your Ad Here

data_list