Skip to content

Instantly share code, notes, and snippets.

View abobija's full-sized avatar

Alija Bobija abobija

View GitHub Profile
@abobija
abobija / init.lua
Created April 1, 2019 09:50
Code written in YouTube video https://bit.ly/2V8BgH9
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')
@abobija
abobija / Program.cs
Created April 2, 2019 13:24
Application written in YouTube video https://bit.ly/2HSPF7n
using NApi32;
using System;
using System.Threading;
namespace Api32ClientApp
{
class Program
{
static void Main(string[] args)
{
@abobija
abobija / init.lua
Created June 18, 2019 16:19
Code written in YouTube video https://youtu.be/Tb3L4UcjlI4
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()
@abobija
abobija / server.js
Created June 20, 2019 15:48
WebSocket NodeJS Server written in YouTube video https://www.youtube.com/watch?v=_Z9Axfh6AEU
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);
});
});
@abobija
abobija / init.lua
Created September 24, 2019 12:14
Code written from YouTube video https://youtu.be/00gPK3rfXZA
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)
@abobija
abobija / index.js
Last active March 20, 2024 22:35
Code written in YouTube video https://youtu.be/q5tOByY1ch4
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() {
@abobija
abobija / index.html
Created September 26, 2019 13:25
Code written in YouTube video https://youtu.be/A_j-nDV46Ik
<!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>
@abobija
abobija / index.html
Last active September 26, 2019 19:19
Code written in YouTube video https://youtu.be/2mlmr_HwWgo
<!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;
@abobija
abobija / Program.cs
Created November 16, 2019 14:22
Code written in YouTube video https://youtu.be/eSS5w29iVl8
using SimpleHttp;
using System.Threading;
namespace SimpleHttpDemo
{
class Program
{
static void Main(string[] args)
{
Route.Add("/", (req, res, props) =>
@abobija
abobija / init.lua
Created November 16, 2019 21:10
Code written for ESP32 in YouTube video https://youtu.be/b6W0ps3IhzA
local rfidmod = nil
local function init_rfid()
if rfidmod ~= nil then
return
end
rfidmod = require('rfid32')({
pin_sda = 22,
pin_clk = 19,