|
Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs * Basic Loops * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory ## Introduction ## Set up the Equipment ## Exploring the Keypad ## Using String Variables ## ASCII ## Seeing ASCII ## Getting a Phone Number ## You try it ## EEPROM * A Simple Hi-Fi PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt |
(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login Seeing ASCII<^< ASCII | Course Index | Getting a Phone Number >^>(:nl:) # In your previous program alter the Keypad Component Macro to use the 'GetKeypadASCII' macro rather than the 'GetKeypadNumber' macro. This will put an ASCII number into the variable 'key'. # Run your program again. You will notice that the ASCII for the key '1' is decimal 49, '2' is 50 etc. No key pressed still returns value 255. # In the LCD Component macro alter the macro 'PrintNumber' to 'PrintASCII'. # Run the program again. You will see that the display once again displays the numbers '1' to '9', '*' and '#'. The no key pressed displays a 'y' with an umlaut - the LCD characters set includes many characters other than just ASCII - see the LCD datasheet for full details. So the interesting thing here is that the ASCII system allows you to store numbers as the ASCII equivalent and then display then as the number equivalent. Here is a standard we can use for storing both numbers and letters at the same time. What we need to do next is implement a system that allows us to gather a string of numbers from the keypad. (:nl:)(:table style="clear:both":)
| |
(:Summary: Website page footer:)
Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login
Page last modified on May 03, 2013, at 08:22 AM