Advertisement
Guest User

example3

a guest
Jan 22nd, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. uint8_t yPosition = LCD_LINE1;
  2. uint8_t xPosition = 0;
  3.  
  4.  
  5. void LCD_Locate(uint8_t x, uint8_t y)
  6. {
  7. switch (y)
  8. {
  9. case 0:
  10. y = LCD_LINE1;
  11. break;
  12. case 1:
  13. y = LCD_LINE2;
  14. break;
  15. }
  16. xPosition = x;
  17. ##
  18.  
  19. ##
  20. t yPosition = LCD_LINE1;
  21. uint8_t xPosition = 0;
  22.  
  23.  
  24. void LCD_Locate(uint8_t x, uint8_t y)
  25. {
  26. switch (y)
  27. {
  28. case 0:
  29. y = LCD_LINE1;
  30. break;
  31. case 1:
  32. y = LCD_LINE2;
  33. break;
  34. }
  35. xPosition = x;
  36. ##
  37. {
  38. case 0:
  39. y = LCD_LINE1;
  40. break;
  41. case 1:
  42. y = LCD_LINE2;
  43. break;
  44. }
  45. xPosition = x;
  46. yPosition = y;
  47. LCD_WriteCmd((LCDC_SET_DDRAM | (y + x)));
  48. }
  49.  
  50.  
  51.  
  52. void LCD_Char(char c)
  53. {
  54. xPosition++;
  55. ##
  56. r)
  57. {
  58. char c;
  59. while ((c = *(str++)))
  60. {
  61. LCD_Position();
  62. LCD_Char(c);
  63. }
  64. }
  65.  
  66.  
  67. void LCD_Position(){
  68. if (xPosition > 15 && yPosition == LCD_LINE1)
  69. {
  70. yPosition = LCD_LINE2;
  71. LCD_Locate(
  72. ##
  73. ition = LCD_LINE2;
  74. LCD_Locate(0, 1);
  75. }
  76. else if (xPosition > 15 && yPosition == LCD_LINE2)
  77. {
  78. yPosition = LCD_LINE1;
  79. LCD_Locate(0, 0);
  80. }
  81. }
  82. ##
  83. https://pastebin.com/raw/cAh0JBXb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement