Download presentation
Presentation is loading. Please wait.
1
Example 9 Binary to ASCII String Conversion
Lecture L4.2
2
Steps for creating an ASCII number string
3
Algorithms to convert a double number to an ASCII string
5
Example 9 // Example 9: Writing INTs and LONGs to LCD
#include <hidef.h> /* common defines and macros */ #include <mc9s12dp256.h> /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b"
6
Example 9 (cont.) int val16; long val32; void main(void) {
PLL_init(); // set system clock frequency to 24 MHz lcd_init(); // enable lcd val16 = 23456; set_lcd_addr(0x0); // display 5-digit int write_int_lcd(val16); val32 = ; set_lcd_addr(0x40); // display 10-digit long write_long_lcd(val32); val16 = 765; set_lcd_addr(0x14); // display 3-digit int val32 = 23456; set_lcd_addr(0x54); write_long_lcd(val32); // display 5-digit long while(1) { }
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.