Skip to content

U8x8 rotate text by 90 degrees #2269

Answered by olikraus
epeschier asked this question in Q&A
Discussion options

You must be logged in to vote

I have created a demo on how to rotate strings by 90 in u8x8:

static uint8_t *rotate90(uint8_t *buf)
{
static uint8_t rbuf[8];
uint8_t i, h;
uint8_t *p;
uint8_t j;
for( i = 0; i < 8; i++)
rbuf[i] = 0;
for( i = 0; i < 8; i++ )
{
h = buf[i];
p = rbuf;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *p |= (h&128); h <<= 1; p++;
*p>>=1; *…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@olikraus
Comment options

@olikraus
Comment options

Answer selected by epeschier
@olikraus
Comment options

@epeschier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants