To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 372
371  |  373
Subject: 
a serial message receive
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Tue, 21 Dec 2004 11:46:57 GMT
Viewed: 
7200 times
  
hello, can say someone to me why this program not functioned?
I connected the exit of spybot with the entrance by a light conductor
and would like a serial message to send and these at the same time receive!

my asks:     1. which worth the message INDEX must have?
             2. which worth the message COMMAND must have?

greeting Peter

task main()
{
int i,j;

SetSerialType( SERIAL_TYPE_USER );           // typ user
SetSerialBaud( SERIAL_BAUD_2400 );           // baud rate 2400
SetSerialChannel( SERIAL_CHANNEL_PC );       // direction pc
SetSerialPreamblePos( 0 );                   // start position preamble
SetSerialPreambleLen( 0 );                   // preamble length
SetSerialChecksum( 0 );                      // chechsum scheme
SetSerialBiPhase( 0 );                       // bi-phase scheme
SetRxMessageLock( 0 );                       // receive buffer unlock

SetSerialData( 0, 0x?? );                    // MSG_INDEX   ???
SetSerialData( 1, 0x?? );                    // MSG_COMMAND ???
SetSerialData( 2, 0xaa );                    // MSG_HI_BYTE
SetSerialData( 3, 0x55 );                    // MSG_LO_BYTE

  do
  {
       SendSerial( 0, 4 );
       Wait( 2 );                             // time to transmit 20ms
       if( RxMessageChannel() == MSG_PC )     // returns MSG_IR or MSG_PC
           PlaySound(SOUND_CLICK);
  }while( true );
}



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR