diff.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. 1,6c1
  2. < //www.DFRobot.com
  3. < //last updated on 26/11/2010
  4. < //Tim Starling Fix the reset bug (Thanks Tim)
  5. < //wiki doc http://www.dfrobot.com/wiki/index.php?title=I2C/TWI_LCD1602_Module_(SKU:_DFR0063)
  6. < //Support Forum: http://www.dfrobot.com/forum/
  7. <
  8. ---
  9. > // LiquidCrystal_I2C V2.0
  10. 10d4
  11. < #include "WProgram.h"
  12. 12c6
  13. <
  14. ---
  15. > #include "Arduino.h"
  16. 67c61
  17. < delay(50);
  18. ---
  19. > delayMicroseconds(50000);
  20. 77,90c71,84
  21. < // we start in 8bit mode, try to set 4 bit mode
  22. < write4bits(0x03 << 4);
  23. < delayMicroseconds(4500); // wait min 4.1ms
  24. <
  25. < // second try
  26. < write4bits(0x03 << 4);
  27. < delayMicroseconds(4500); // wait min 4.1ms
  28. <
  29. < // third go!
  30. < write4bits(0x03 << 4);
  31. < delayMicroseconds(150);
  32. <
  33. < // finally, set to 4-bit interface
  34. < write4bits(0x02 << 4);
  35. ---
  36. > // we start in 8bit mode, try to set 4 bit mode
  37. > write4bits(0x03);
  38. > delayMicroseconds(4500); // wait min 4.1ms
  39. >
  40. > // second try
  41. > write4bits(0x03);
  42. > delayMicroseconds(4500); // wait min 4.1ms
  43. >
  44. > // third go!
  45. > write4bits(0x03);
  46. > delayMicroseconds(150);
  47. >
  48. > // finally, set to 4-bit interface
  49. > write4bits(0x02);
  50. 225c219
  51. < inline void LiquidCrystal_I2C::write(uint8_t value) {
  52. ---
  53. > inline size_t LiquidCrystal_I2C::write(uint8_t value) {
  54. 226a221
  55. > return 0;
  56. 235,238c230,233
  57. < uint8_t highnib=value&0xf0;
  58. < uint8_t lownib=(value<<4)&0xf0;
  59. < write4bits((highnib)|mode);
  60. < write4bits((lownib)|mode);
  61. ---
  62. > uint8_t highnib=value>>4;
  63. > uint8_t lownib=value & 0x0F;
  64. > write4bits((highnib)|mode);
  65. > write4bits((lownib)|mode);
  66. 248c243
  67. < Wire.send((int)(_data) | _backlightval);
  68. ---
  69. > Wire.write((int)(_data) | _backlightval);