hex to char problem

This is a discussion on hex to char problem within the C++ Programming forums, part of the General Programming Boards category; hey guys, i am trying to communicate serially with a camera through my microcontroller i have to send hex command ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    1

    hex to char problem

    hey guys,

    i am trying to communicate serially with a camera through my microcontroller

    i have to send hex command 56:00:26:00

    the uart function only takes in char pointer to send the data

    so in char, command is V:nullchar:&:nullchar

    nullchar terminates the flow and only V is sent

    pl suggest something.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,529
    First suggestion: try to describe your problem in a way that mere mortals, other than yourself, can understand.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy in reply to you, it is likely you deserve it. Suck it up, sunshine, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    48
    Have you tried sending "56:00:26:00" as a C-style string?

  4. #4
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,500
    Quote Originally Posted by rups21489 View Post
    hey guys,

    i am trying to communicate serially with a camera through my microcontroller

    i have to send hex command 56:00:26:00

    the uart function only takes in char pointer to send the data

    so in char, command is V:nullchar:&:nullchar

    nullchar terminates the flow and only V is sent

    pl suggest something.
    If it is a Canon Camera, take a look at CHDK, you'd find many of this kind of Questions answered in their developer Wiki.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 08-09-2011, 01:41 PM
  2. char* Problem
    By BWHazel in forum C Programming
    Replies: 2
    Last Post: 04-24-2010, 03:27 PM
  3. Conversion Char To Char * Problem
    By ltanusaputra in forum Windows Programming
    Replies: 3
    Last Post: 03-01-2008, 02:06 PM
  4. C++ (char *) problem?
    By Teegtahn in forum C++ Programming
    Replies: 4
    Last Post: 02-05-2008, 01:23 PM
  5. Problem with char and char*
    By chris1985 in forum C Programming
    Replies: 1
    Last Post: 05-08-2005, 12:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21