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
| local BLUE_LED = 2 | |
| gpio.config({ gpio = BLUE_LED, dir = gpio.IN_OUT }) | |
| gpio.write(BLUE_LED, 0) | |
| local api = nil | |
| local function init_api32() | |
| if api == nil then | |
| api = require('api32') |
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
| using NApi32; | |
| using System; | |
| using System.Threading; | |
| namespace Api32ClientApp | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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
| local function init_ws() | |
| require('ws32_client') | |
| .on('receive', function(data, ws) | |
| print('WS received: ', data) | |
| end) | |
| .on('connection', function(ws) | |
| print('WS connected') | |
| local timer = tmr.create() |
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
| const app = require('express')(); | |
| const appWs = require('express-ws')(app); | |
| app.ws('/echo', ws => { | |
| ws.on('message', msg => { | |
| console.log('Received: ', msg); | |
| ws.send(msg); | |
| }); | |
| }); |
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
| local username = 'ADAFRUIT_IO_USERNAME' | |
| local aioKey = 'ADAFRUIT_IO_KEY' | |
| local feed = 'ADAFRUIT_IO_MQTT_FEED_NAME' | |
| local sda = 26 | |
| local scl = 27 | |
| local sla = 0x3c | |
| i2c.setup(i2c.HW0, sda, scl, i2c.FAST) | |
| local disp = u8g2.ssd1306_i2c_128x64_noname(i2c.HW0, sla) |
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
| var mqtt = require('mqtt'); | |
| var client = mqtt.connect('mqtt://io.adafruit.com', { | |
| username: 'ADAFRUIT_IO_USERNAME', | |
| password: 'ADAFRUIT_UI_KEY' | |
| }); | |
| var ssd1306topic = `${client.options.username}/f/ssd1306`; | |
| client.on('connect', function() { |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>ESP32</title> | |
| </head> | |
| <body> | |
| <h1>Hello from ESP32</h1> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>ESP32</title> | |
| <style> | |
| button { | |
| padding: 20px; |
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
| using SimpleHttp; | |
| using System.Threading; | |
| namespace SimpleHttpDemo | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Route.Add("/", (req, res, props) => |
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
| local rfidmod = nil | |
| local function init_rfid() | |
| if rfidmod ~= nil then | |
| return | |
| end | |
| rfidmod = require('rfid32')({ | |
| pin_sda = 22, | |
| pin_clk = 19, |
OlderNewer