zvika

Raspberry Pi Blynk Virtual Write GPS Example

Nov 26th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import BlynkLib
  2. import time
  3. import RPi.GPIO as GPIO
  4.  
  5. BLYNK_AUTH = '284f1abe751f481a8d4e4d3e3e133614'
  6.  
  7. gpioPin = 26
  8.  
  9. GPIO.setwarnings(False)
  10. GPIO.setmode(GPIO.BCM)
  11. GPIO.setup(gpioPin, GPIO.OUT, initial=GPIO.LOW)
  12.  
  13. # Initialize Blynk
  14. blynk = BlynkLib.Blynk(BLYNK_AUTH)
  15.  
  16. # Register virtual pin handler
  17. @blynk.VIRTUAL_WRITE(1)
  18. def v0_write_handler(value):
  19.   print('Current value: {}'.format(value))
  20.  
  21. # Start Blynk (this call should never return)
  22. blynk.run()
Add Comment
Please, Sign In to add comment