ASCII using text clips

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi, 

 

iv been learning basic LCD AVR programing using AS7 and have seen a tutorial on youtube that refers to using "text clips" box as a like reference for ASCII keys but cant find this in the program 

 any where dose anyone know where it is hiding ?

   

link to tutorial at the right time so you can see what i mean: https://youtu.be/uCKShSBdDG8?t=385

 

thanks

ben

Last Edited: Mon. Mar 20, 2017 - 07:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This forum is for Studio issues only, I'll move the thread to general programming.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Terrible tutorial!  If you want to send an "A" to a function, you shouldn't be using some app to discover than an "A" is 0x41, you should be using the appropriate form of quotes:

   SendChar('A');

(Single quotes to get the ascii value of a single character.   Double quote would create a C "string" - a null-terminated array of single characters...)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
you shouldn't be using some app to discover than an "A" is 0x41

Sometimes it is useful to manually look-up the ASCII code for a character, or to find what character corresponds to a particular code.

 

There are loads of places on the interwebs where you can find an "ASCII Chart" or "ASCII Table"; eg, 

 

http://www.asciitable.com/

 

Print one out, and stick it on the wall near you monitor.

 

Maybe also stick a copy in your notebook or logbook or whatever ...

 

Ascii Table

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That "text clips" looks like it might be some kind of visual studio add-on. But like others have said, specifying characters codes is a terrible idea. What is easier to read:

SendChar(0x48);
SendChar(0x69);

or

SendChar('H');
SendChar('i');

They both print "Hi" but a human being can already see that in the second version.

 

On the rare occasion I do need to look up such a character code (as I just did for this example) I simply use the same www.asciitable.com that Andy just linked to.

 

I do wonder about some of these "internet tutorials"! The problem for the reader/viewer is that you can never gauge the provenance of the "information" being given.

 

EDIT: Just watched some more of the video - hadn't realised that  this is the excrable "MrLCD" code! Possibly the worst piece of AVR code ever written. It is a steaming pile of poo. There must be 1,000 different libraries for driving an HD44780 from an AVR and this piece of code wins an award for being at the very bottom of the list. frown

Last Edited: Mon. Mar 20, 2017 - 09:24 AM