This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "DHT.h" //by adafruit (download entire library) | |
| #define UPDATE_INTERVAL 10000 | |
| //temperature pin, type dht11 | |
| #define DHT_P 8 | |
| //relé module | |
| #define LED_P A1//12v, 0.5ah - 6w | |
| #define FAN_P A2//12v, 0.5ah - 6w |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Paste this script in Google Apps Script, will be available as function in Sheet by using =fetchPrice('SYMBOL') ex =fetchPrice('BTC') | |
| If you want to auto-update the price every time your open the Sheet, in Apps Script click on Triggers and add a new trigger | |
| Select the behavior you prefer and save. | |
| */ | |
| function fetchPrice(symbol = 'BTC') { | |
| const res = UrlFetchApp.fetch(`https://api.kucoin.com/api/v1/market/stats?symbol=${symbol}-USDT`); | |
| const obj = JSON.parse(res.getContentText()); | |
| return parseFloat(obj.data.buy) |