This file contains 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
// Load accelerometer | |
var adxl345 = require('jsupm_adxl345'); | |
// Instantiate on I2C bus | |
var adxl = new adxl345.Adxl345(0); | |
// Initialize the hardware device | |
var screen = new (require("jsupm_i2clcd").SSD1308)(0, 0x3C); | |
// Displays a message on the OLED display |
This file contains 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
-- Your access point's SSID and password | |
local SSID = "greenhouse" | |
local SSID_PASSWORD = "senhasupersecreta" | |
local DEVICE = "undefined" | |
local timesRunned = 0 | |
SDA_PIN = 6 -- sda pin, GPIO12 | |
SCL_PIN = 5 -- scl pin, GPIO14 | |
-- configure ESP as a station |
This file contains 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
-- Your access point's SSID and password | |
local SSID = "greenhouse" | |
local SSID_PASSWORD = "senhasupersecreta" | |
local DEVICE = "undefined" | |
local temperature = 27.5 | |
local timesRunned = 0 | |
-- configure ESP as a station | |
wifi.setmode(wifi.STATION) | |
wifi.sta.config(SSID,SSID_PASSWORD) |
This file contains 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
// The received message is stored in 'msg' | |
// It will have at least a 'payload' property: | |
// console.log(msg.payload); | |
// The 'context' object is available to store state | |
// between invocations of the function | |
// context = {}; | |
//expects JSON payload and destination specified in topic | |
var key = "your api key here"; |
This file contains 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
-- Your access point's SSID and password | |
local SSID = "greenhouse" | |
local SSID_PASSWORD = "senhasupersecreta" | |
local DEVICE = "device001" | |
local temperature = 27.5 | |
-- configure ESP as a station | |
wifi.setmode(wifi.STATION) | |
wifi.sta.config(SSID,SSID_PASSWORD) | |
wifi.sta.autoconnect(1) |
This file contains 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
--- Config | |
SSID = "Dark side of the Force" | |
PASSWORD = "senhasupersecreta" | |
TIMEOUT = 30000000 -- 30s | |
--- Station modes | |
STAMODE = { | |
STATION_IDLE = 0, | |
STATION_CONNECTING = 1, | |
STATION_WRONG_PASSWORD = 2, |
This file contains 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
-- *************************************************************************** | |
-- BH1750 module for ESP8266 with nodeMCU | |
-- BH1750 compatible tested 2015-1-22 | |
-- | |
-- Written by xiaohu | |
-- | |
-- MIT license, http://opensource.org/licenses/MIT | |
-- *************************************************************************** | |
local moduleName = ... | |
local M = {} |
This file contains 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
pin = 4 | |
status,temp,humi,temp_decimial,humi_decimial = dht.read(pin) | |
if( status == dht.OK ) then | |
-- Integer firmware using this example | |
print( | |
string.format( | |
"DHT Temperature:%d.%03d;Humidity:%d.%03d\r\n", | |
math.floor(temp), | |
temp_decimial, | |
math.floor(humi), |
This file contains 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
source: https://marciocabreira.wordpress.com/2011/08/14/criando-links-simbolicos-no-windows-com-mklink/ | |
J:\Steam\steamapps\common\Grand Theft Auto V | |
C:\Grand Theft Auto V | |
mklink /D "J:\Steam\steamapps\common\Grand Theft Auto V" "C:\Grand Theft Auto V" |
This file contains 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
--- Config | |
SSID = "YOUR_WIFI_NAME" | |
PASSWORD = "YOUR_WIFI_PASSWORD" | |
TIMEOUT = 30000000 -- 30s | |
--- Station modes | |
STAMODE = { | |
STATION_IDLE = 0, | |
STATION_CONNECTING = 1, | |
STATION_WRONG_PASSWORD = 2, |