السلام عليكم
هذا كود كتبته بس للأسف ناقص بعض التعريفات
الكود يرسل عبر السريال بورت (طبعا مع بعض الاضافات كــ loop)
أرجو من من يعرف يكمله أن يكمله لتعم الفائدة لي و للجميع
#includ(stdio.h)
void main (void)
{
int a;
private serialport port= new serialport ("com4", 9600,parity.none,8,stopbits.one);
port.open();
printf ("Welcom to video multiplexing project\n\n");
printf ("Enter 1 for Cam. 1, 2 for Cam. 2, 3 for cam. 3\n");
while (1)
{
printf ("Com. ");
scanf ("%d\n",a);
if (a>3)
{
printf ("The number entered is not available. Please enter 1 for Cam. 1, 2 for Cam. 2, 3 for cam. 3\n");
scanf ("%d\n",a);
else
if(a==1)
{
port.write (new byte[] {0xFE},0,1);
else
if(a==2)
{
port.write (new byte[] {0xFD},0,1);
else
if(a==3)
{
port.write (new byte[] {0xFB},0,1);
}
}