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

  • SEARCH
  • Home
  • 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 7832647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:19:55+00:00 2026-06-02T12:19:55+00:00

I’m programming AVR microcontroller Atmega16 in C. I don’t understand C, i spend my

  • 0

I’m programming AVR microcontroller Atmega16 in C.

I don’t understand C, i spend my time programming in PHP, and i just don’t get it in C.

I don’t get also how can i post sourcecode here.
If someone know, please fix my tags.

My problem is, i have this function:

unsigned char
convert_sn_to_string (const unsigned char *SN_a /* IDstring */      )
{
  unsigned char i;

  for (i = 0; i < 6; i++)   //6 byte az SN 
    {

 if(SN_a[i]==0x00)
     {
     Send_A_String("00");
     }


    }


  return 1;
}

Inside for loop i can acces 6 byte value by hex.

Inside variable SN_A i can have

SN_A[0]=0x00;
SN_A[1]=0xFF;
SN_A[3]=0xAA;
SN_A[4]=0x11;
(...)

and similar.
It could be from 00 to FF.

What i need, is to convert that code to 12 char string.
If i have

SN_A[0]=0x00;
SN_A[1]=0xFF;
SN_A[3]=0xAA;
SN_A[4]=0x11;
(...)

I would like get at output

new[0]=0;
new[1]=0;
new[2]=A;
new[3]=A;
new[4]=1;
new[5]=1;
(...)

and so to 12, because i would like change that 6 (double) AA values, to separated.

So then i can do a loop

for i=0 i<12 i++
{
  do_something_with_one_letter(new[i]);
}

Now i can play with that values, i can send them to display, or anything i need.

  • 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-02T12:19:59+00:00Added an answer on June 2, 2026 at 12:19 pm

    A hex value is simply another way of writing integers. 0xFF == 255.

    So, if you want to “split” them, you need to first decide how you want to split them. This, essentially, decides on the exact way you stuff the split values into your new array.

    To split a value, something like this can be used:

    hexval = 0x1A
    low_nybble = hexval & 0xF
    high_nybble = (hexval >> 4) & 0xF
    

    You now have 1 stored in high_nybble and 10 stored in low_nybble.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.