Şimdi Ara

RS232'yi LPT'ye çeviren devre lazım

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
1
Cevap
0
Favori
103
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • beyler rs232 devC++ bi kod yazdım ve bu kodu paralele çevirmem lazım( gerçi daha tam çalışmıyo ama UNABLE TO OPEN COMPORT HATASI VERİYO YARDIMA İHTİYACIM VAR) kod şu
    #include <iostream>
    #include <string>
    #include <windows.h>
    #include <time.h>
    #include <stdio.h>
    #include <dos.h>
    #include<conio.h>
    #include "rs232.h"
    #include "rs232.c"

    using namespace std;
    int main()
    {
    int y,x,A;
    while (1)
    {
    cout <<"sag icin 1 sol icin 2 durdurmak icin 3 "<< endl;
    cin >> x;
    A=1000;
    if (x==3) break;
    if (x==1)
    {
    do{
    cout << "saga donuyor" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());



    }
    else
    {
    if (x==2)
    {
    do{
    cout << "sola donuyor" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());
    }
    else
    {
    }
    }
    while (1)
    {
    system("cls");
    cout <<"hizlanmak icin 4 yavaslamak icin 5 yon degistirmek icin 6 ya basin"<< endl;
    cin >> y;
    if (y==6) break;
    if (x==1 && y==4)
    {
    A=A-250;
    do{
    cout << "saga donerek uykuyu azalt step hizlansin" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());
    }
    else
    {
    if (x==2 && y==4)
    {
    A=A-250;
    do{
    cout << "sola donerek uykuyu azalt step hizlansin" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());
    }
    else
    {
    if (x==1 && y==5)
    {
    A=A+250;
    do{
    cout << "saga donerek uykuyu artir step yavaslasin" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());

    }
    else
    {
    if (x==2 && y==5)
    {
    A=A+250;
    do{
    cout << "sola donerek uykuyu artir step yavaslasin" << endl;
    RS232_OpenComport (3, 9600);
    RS232_SendByte(3, 1);
    Sleep(A);
    RS232_SendByte(3, 2);
    Sleep(A);
    RS232_SendByte(3, 4);
    Sleep(A);
    RS232_SendByte(3, 8);
    Sleep(A);
    RS232_CloseComport(3);
    }
    while(!kbhit());
    }
    else
    {
    cout << "hatali veri girdiniz." << endl; }
    }
    }
    }
    }
    }
    cout << "bitti." << endl;
    return 0;
    }

    bu kod ile step motor sürmem lazım lütfen yardım edin







  • Yapay Zeka’dan İlgili Konular
    LPT den USB Ucu Bakabilirmisiniz ?
    12 yıl önce açıldı
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.