From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,87b54dbabc658fa2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.75.137 with SMTP id y9mr3844346qaj.3.1366865695407; Wed, 24 Apr 2013 21:54:55 -0700 (PDT) X-Received: by 10.49.104.209 with SMTP id gg17mr6981qeb.7.1366865695392; Wed, 24 Apr 2013 21:54:55 -0700 (PDT) Path: ef9ni16888qab.0!nntp.google.com!gp5no6665134qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Apr 2013 21:54:55 -0700 (PDT) In-Reply-To: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.188.246.250; posting-account=mOyWBQoAAAD7S-NBmMUOr9hRClcL0vqR NNTP-Posting-Host: 87.188.246.250 References: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: AVR Usart send number string with no 'Image From: rrr.eee.27@gmail.com Injection-Date: Thu, 25 Apr 2013 04:54:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-04-24T21:54:55-07:00 List-Id: On Thursday, April 25, 2013 3:27:52 AM UTC+2, Rego, P. wrote: > I am trying to send a numeric string over Usart in an AVR ATmega2560, usi= ng avr-elf-windows. So I coded a function Put (Data : String) which works w= ell, and a function Put (Data : Unsigned_8) which actually sends the Charac= ter represented by Data : Unsigned_8.=20 >=20 >=20 >=20 > But I need now a function which sends really the number, not its equivale= nt character. So I think I could convert the number into a string and send = it. The problem is that avr-elf-windows has no 'Image available, so I have = to implement it by hand. How could I do it? >=20 See the package AVR.Int_Img in AVR-Ada. It contains various attempts for g= enerating string representations of integers. http://sourceforge.net/p/avr-ada/code/ci/master/tree/avr/avr_lib/avr-int_im= g.ads http://sourceforge.net/p/avr-ada/code/ci/master/tree/avr/avr_lib/avr-int_im= g.adb The next version of AVR-Ada will add a new way based on Dmitry's String_Edi= t package. http://www.dmitry-kazakov.de/ada/strings_edit.htm HTH=20 Rolf