AVR + uart

May 18, 2006 1 Replies

Witam, bawie sie teraz usartem w atmega32. Uzywam AVR Studio i bazgrze w c. Odbieranie idzie mi bez wiekszego problemu ale zastanawiam sie nad takim tematem mam tak:



uint8_t rs_command[sizeof(int)*8+1];



pozniej oczekuje z uzyciem case na 0x0d czyli enter.



no i powiedzmy jak wpisze a11 enter to mam na pozycjach rs_command[0] a 1 1



2 1 tylko ze mnie interesuje 11 jako liczba a nie jako pojedyncze 2 jedynki. Jak to zrobic by odczytac liczbe 11?


Pozdrawiam, Mario.



U¿ytkownik "angel" snipped-for-privacy@REMMEszas.uk.to> napisa³ w wiadomo¶ci news:e4i9t1$501$ snipped-for-privacy@nemesis.news.tpi.pl...

moze sscanf() ? a moze wyciac kawalek i atoi() ?

albo strtol()

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required