سلام امروز يه مدار سندر و رسيور ليزري ميزارم اميدوارم كه خوشتون بياد اين هم چند تا عكس از مدار
اين هم نحوه ساخت پورتrs-232
اين هم از DB-9 يا DB-25 كه فرقي نميكنه
http://tinypic.com/dfab1w.jpg
و اين هم لوازم:
Transceiver
R1 1k 1/4 W resistor
C1-5 0.1uF Capacitor (Ceramic
U1 MAX232A RS-232 line driver
U2 74LS05 Hex open-collector buffer
U3 74LS14 Schmitt trigger hex inverter
D1-2 1N4001 Power diode
P1 OP505A Photo-transistor
V1 7805 Voltage regulator
L1 LX1000 Laser Pointer
9V battery
DB-9 female connector with backshell
2 m shielded 3 core cable
Switch
Light duty hook-up wire
PCB
__________________________________________
Transmitter
R1 1k 1/4 W resistor
C1 0.1uF Capacitor (Ceramic
U1 4N33 Opto-coupler
U2 74LS05 Hex open-collector buffer
D1-2 1N4001 Power diode
V1 7805 Voltage regulator
L1 LX1000 Laser Pointer
9V battery
DB-9 female connector with backshell
2 m shielded 2 core cable
Switch
PCB
Light duty hook-up wire
_______________________________________________
اين هم برنامه واسه c++كه با يه كامپايلر ساده3.1 هم ميشه كامپايلش كرد البته من خودم كامپايل شدش رو دارم كه الان نمي دونم كجاي كامپيوترم هستش ولي بعدا اون رو هم ميزارم
_______________________
#include <dos.h>
#include <stdlib.h>
#include <conio.h>
#include <bios.h>
#include <stdio.h>
#define COM1 0
#define COM2 1
#define DATA_READY 0x100
#define TRUE 1
#define FALSE 0
#define ESC_KEY '\x1b'
#define SETTINGS ( _COM_9600 | _COM_CHR8 | _COM_NOPARITY | _COM_STOP1)
void clear_line(int line)
{
int i;
gotoxy(1,line); // clear a whole line
for(i=0;i<80;i++)
printf(" ");
}
int main(int argc, char *argv[])
{
int in, out, status, done = FALSE;
int curs_rx=0,curs_ry=15,curs_tx=0,curs_ty=4;
int com_port=COM1;
if (!(argc == 2 && (argv[1][0] == '2' || argv[1][0] == '1')))
{
printf("Usage: LASER [1|2]\nwhere 1 = Com port 1\n 2 = Com port 2\n");
exit(-1);
}
if (argv[1][0]=='2') // select com port
com_port = COM2;
else
com_port = COM1;
bioscom(_COM_INIT, SETTINGS, com_port); // Initialize serial port
clrscr();
printf(" GKDesign (c) 1997 Laser Transceiver Communicator V1.1\n");
printf(" Press [ESC] to exit program\n");
printf("__________________________________ Sent Data ___________________________________");
gotoxy(1,13);
printf("________________________________ Recieved Data _________________________________");
while (!done) {
status = bioscom(_COM_STATUS, 0, com_port); // recieved data?
if (status & DATA_READY)
if ((out = bioscom(_COM_RECEIVE, 0, com_port) & 0x7F) != 0) { // get data
if (curs_rx < 78) // move cursor
curs_rx++;
else {
curs_rx = 1; // at end of line
if (curs_ry < 23)
curs_ry++;
else
curs_ry = 15;
clear_line(curs_ry);
}
gotoxy(curs_rx,curs_ry); // goto correct screen location
putch(out); // print the character
}
if (kbhit()) {
if ((in = getch()) == ESC_KEY) // check for ESC key
done = TRUE;
if(!in) // read an extended character
in = getch();
if (curs_tx < 78) // position cursor
curs_tx++;
else {
curs_tx = 1; // at end of line
if (curs_ty < 12)
curs_ty++;
else
curs_ty = 4;
clear_line(curs_ty);
}
gotoxy(curs_tx,curs_ty); // goto correct screen location
putch(in); // print the character
bioscom(_COM_SEND, in, com_port); // output data
}
}
clrscr();
return (0);
}
_________________________________
گه مي خايين ادامه بدم بگين اگه نه......من رو ايگنور كنين