[text] IoT

Viewer

  1. import thingspeak
  2. import time
  3. import random as r
  4. #import adafruit_dht
  5. import time
  6. channel_id=2537509#your channel id
  7. write_key='DXTVGPDYRGI8DDSY'#your write key
  8. channel=thingspeak.Channel(id=channel_id,api_key=write_key)
  9. #DHT_SENSOR=Adafruit_DHT.DHT11
  10. #DHT_PIN=4
  11. while True:
  12.     n=r.randint(30,50)
  13.     print(n)
  14.     response=channel.update({'field1':n,'field2':n+2})

Editor

You can edit this paste and save as new:


File Description
  • IoT
  • Paste Code
  • 06 May-2024
  • 378 Bytes
You can Share it: