الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

problem : car control using PC

مغلق
بدأه mayabader في 9 مارس 2006 · 1 رد · 578 مشاهدة · في التحكم الصناعي وربط الحاسب بالعالم الخارجي
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

have itegrated the car by using DC motor(for moving the car forward and backward) and stepper motor(for moving the car right and left)

and i start to write the code (borland C++) i have wrote the code for moving the car forward and backward , but am facing problem for writing the code for moving the car left and right (the code i wrote is followed), plz try to help as soon as u can am really in need for ur help to complete the code..............

thank u very much and this is my code :


#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
void f();
void r();
void main()
{
while(1)

{
  if( input_a()==0x01)
    f();
  else if(input_a()==0x02)
    r();  

}


}

void f()
{
    output_b(0x01);
   delay_us(10);
   output_b(0x02);
   delay_us(10);
   output_b(0x04);
   delay_us(10);
   output_b(0x08);
   delay_us(10);
 

}


void r()
{
   output_b(0x08);
   delay_us(10);
   output_b(0x04);
   delay_us(10);
   output_b(0x02);
   delay_us(10);
   output_b(0x01);
   delay_us(10);
 
}
#include <16f877a.h>

تم تعديل هذه المشاركة بواسطة Xacker في 10 مارس 2006 في 00:40

#2

elgoeg و ضح اكثر ..

mayabader اهلاً بك بالمنتدي و نرجوا الاستمرار .

للدوران يمين أو يسار تقومي بتحريك عجلة للامام و عجلة للايسار (اي قوتان متساويتين في المقدار و متضادتان في الاتجاه فيحدث عزم دوران ) و ايضاً للدوران لليسار تحرك عجلة للامام و الاخري عكسها :) و كما اري من كودك انك تستخدمين PWM يمكن تطبيقها عادي جداً ايضاً في الدوران .

احمد

BEng , Electronics and communications.

Embedded systems engineer.

Graphics Programmer

عالم الكومبيوتر هو من لديه المعرفة في علوم الكومبيوتر ، الرياضيات ، هندسة الالكترونيات -احمد صالح

هذا الموضوع مغلق.

مواضيع مشابهة