Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
/*
AnalogReadPot
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/AnalogReadSerial
*/
/* "auto" makes the left and right margins center the wrapper */
#wrap {
width: 150px;
margin: 0 auto;
}
(function() {
var socket = io.connect(window.location.hostname + ':' + 3000);
var red = document.getElementById('red');
var green = document.getElementById('green');
var blue = document.getElementById('blue');
function emitValue(color, e) {
socket.emit('rgb', {
color: color,
value: e.target.value
});
{
"name": "arduino-rgb-sockets",
"version": "1.0.0",
"description": "Control a RGB LED using Websockets and johnny-five",
"main": "rgb.js",
"dependencies": {
"express": "^4.13.4",
"johnny-five": "^0.9.56",
"socket.io": "^1.4.6"
},
<!doctype html>
<html lang="en">
<head>
<title>Arduino</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="wrap">
<h3>Red:</h3>
<input id="red" type="range" min="0" max="255" step="1" value="0">
'use strict';
const five = require('johnny-five');
const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
let led = null;
Name
mosquitto_pub — an MQTT version 5/3.1.1/3.1 client for publishing simple messages
Synopsis
mosquitto_pub { [-h hostname] [-p port-number] [-u username]
[-P password] -t message-topic... | -L URL }
[-A bind-address] [-c] [-d] [-D command identifier value]
[-i client-id] [-I client-id-prefix] [-k keepalive-time]
[-q message-QoS] [--quiet] [-r] [--repeat count] [--repeat-delay seconds]
[-S] { -f file | -l | -m message | -n | -s }
/*
Project : FreeRTOS - How to Get Started!
Episode 01 : Hello world ESP-32 - Using Heltec WiFi LoRa 32
File : heltec_oled_hello_world.ino
Webpage : https://medium.com/jungletronics/meet-iot-boards-esp8266-esp32-ba12e41c1a3b
Hardware : https://heltec.org/project/wifi-lora-32/
Specs ESP8266 12E ESP-32 Arduino UNO R3 Raspberry PI 3 B+
Power Rating 197 mA 220 mA 200mA 459mA
Core 1 2 1 4×Cortex-A53
Arquitecture 32-bits 32-bits 8-bits 64-bits
Clock 80-160MHz 160-240MHz 16MHz 1.4GHz
WiFi Yes Yes No b/g/n/ac dual band
Bluetooth No Yes-Classic & BLE No 4.2 LS BLE
RAM 160KB 520KB 2K 1GB
Flash 16MB 16MB 32KB 1-2 or 4GB LPDDR4-3200 RAM
GPIO 11 22 12 40 (28 accessable)
ESP-32 Description
Core 2
Arquitecture 32 bits
Clock Tensilica Xtensa LX106 160-240MHz
WiFi IEEE802.11 b/g/n
Bluetooth Yes - classic & BLE
RAM 520KB
Flash Extern QSPI - 16MB
GPIO 22
DAC 2