Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:09:56+00:00 2026-06-15T23:09:56+00:00

I need to send some number sequences to a microcontroller. Here is my function:

  • 0

I need to send some number sequences to a microcontroller. Here is my function:

void DriveForward()
{       
      printf("137 0 0 128 0");          
}

The micro does not accept ASCII while my function sends as ASCII. I need to send that ASCII string as uint8. Any idea how can I do the conversion?

In this case, printf does not print on screen but it directly sends to serial port. And its the only command that sends to serial port, so I need to do some conversion beforehand.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:09:58+00:00Added an answer on June 15, 2026 at 11:09 pm

    I may be confused by your question, but you can try something like (just for this case to test):

      printf("%c%c%c%c%c", 137, 0, 0, 128, 0);
    

    This will send four characters encoded in ASCII with the numerical values you put afterwards.

    Also, most technical documentation that tells you that you should use uint8 is refering that you send to the cable a full 8-bit value (speaking of characters here or ASCII then does not apply. They’re just values of 8 bits that can be represented using an unit8).

    How this is usually done is by using some low-level functions such as write, that can send an buffer of uint8, so, if you have to send that values, you can have a buffer like this:

    uint8 send_buffer[] = {137, 0, 0, 128, 0};
    

    and then:

    write (send_buffer, 5, output_file_or_serial_conn);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send some strings (name, number) from my C# application to my
I need to send some bytes over UDP Protocol the start squence is 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
I need to send some information on a VxWorks message queue. The information to
I need to send some arguments from the iPhone to a php in the
I need to send some byte array from android device to Servlet. For this
I need to send some data with radio button. This buttons are <td> <span
In my project client send some text, some images to the server. Server need
I need to send SOAP requests to some web servicer as part of a
I need to apply some pixel shaders to a bitmap (using OpenGL) and send
I need to implement some form of communication mechanism in my application, to send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.