Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
For your examples it's easy. ABCDEFG corresponds to hex 0x41, 0x42, 0x43 ect. If you simply mask the high nibble (AND with 0xF0) then pack 0x30 (OR with 0x30), then 0x41 will be converted to 0x31 ( this is ASCII code for digit "1". To use letters of the alphabet past an index of 9, you will need to utilize a lookup table. In this case I would recommend masking the highest 3 bits and using the results as the index in the table.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.