Advertisement
lightxx

RPI LCD Interrupt

Aug 22nd, 2013
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. This program runs on Raspberry pi plus the Adafruit RGB 16x2 LCD+Keypad Kit
  2. The purpose of this program is to use the interrupts instead of constantly polling the
  3. Buttons. This is a modifiation of Adafruit_CharLCDPlate.py. We enable the interrupts on
  4. both the MCP23017 AND the Raspberry Pi GPIO. Then we electrically link them:
  5.  
  6. The MCP23017 INTA pin is connected to Raspberry pi GPIO 23 through a resistor divider,
  7. to reduce the MCP23017 5V to an acceptable level for the pi.
  8.  
  9. +----------------------+
  10. | | +---------+ +-----------+
  11. | MCP23017 20|+------->| 680 Ohms|+--+--->| 820 Ohms |<-------+ GND
  12. | | +---------+ | +-----------+
  13. +----------------------+ v
  14. GPIO 23
  15.  
  16. Just make sure you have the latest RPi.GPIO version https://pypi.python.org/pypi/RPi.GPIO
  17.  
  18. Then run this software:
  19. $ sudo python UseInterruptGPIO.py
  20.  
  21. and press the buttons..
  22. Interrupts do it better:-)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement