Controlling PTZ Camera using mcu

Discussion in 'Embedded Systems and Microcontrollers' started by crazyengineer, Dec 5, 2012.

  1. crazyengineer

    Thread Starter Member

    Dec 29, 2010
    156
    2
    So for a part time job, I have to control a camera using a pic microcontroller. I was reading how to control a PTZ camera using rs 485. Although I ready now that I need to get a Max485 chip to allow the pic to do serial communication with the camera, I'm still a little confused on how to send the serial command.

    For example, in order to move the camera up, it must receive a message 0x02012800002b (see page 5). So do I have write the following for PIC in order for the pic to tell the camera to move up?
    Code ( (Unknown Language)):
    1.  
    2. putcUSART(0x2b);
    3. putcUSART(0x00);
    4. putcUSART(0x00);
    5. putcUSART(0x28);
    6. putcUSART(0x01);
    7. putcUSART(0x02);
    8.  
    ?
     
  2. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,130
    266
    Just reverse the order of the bytes.
     
Loading...