Skip to content

Instantly share code, notes, and snippets.

View giobauermeister's full-sized avatar
🤖
creating things...

Giovanni Bauermeister giobauermeister

🤖
creating things...
View GitHub Profile
//Programa: Automacao Residencial com Arduino e Ethernet Shield
//Autor: FILIPEFLOP
#include <SPI.h>
#include <Ethernet.h>
String readString;
int pino_rele1 = 3;
int pino_rele2 = 4;
int pino_rele3 = 7;
function AlteraRele1(){
var estado = document.getElementById("estado").innerHTML;
if(estado === "0"){
document.getElementById("estado").innerHTML="1";
document.getElementById("rele").innerHTML="<div class='rele1_ligado'></div>";
document.getElementById("botao").innerHTML="<a href='/?desligar' class='botao'>Desliga</a>";
} else {
document.getElementById("estado").innerHTML="0";
document.getElementById("rele").innerHTML="<div class='rele1_desligado'></div>";
document.getElementById("botao").innerHTML="<a href='/?ligar' class='botao'>Liga</a>";
/*
CSS Projeto Automacao Residencial
FILIPEFLOP Componentes Eletronicos
*/
root {
display: block;
}
body {
const uint8_t myImage[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x
{
"short_name": "NodeMCU Robot",
"name": "NodeMCU Robot",
"icons": [
{
"src": "https://raw.githubusercontent.com/giobauermeister/berryE-raspberrypi-robot/master/public/images/robot-icon.png",
"sizes": "192x192",
"type": "image/png"
}
],
@giobauermeister
giobauermeister / teste-rele.ino
Created January 19, 2018 11:54
teste de 2 módulos relé 4 canais
void setup() {
int i;
for(i=2; i<=9; i++)
{
pinMode(i, OUTPUT);
}
}
void loop() {
int i;
@giobauermeister
giobauermeister / app.js
Created November 16, 2017 20:10
pequeno exemplo mostrando como comunicar um botão de uma página web com um servidor nodejs, usando express e socket.io
var express = require('express');
var app = express();
var path = require('path');
var server = require('http').Server(app);
var io = require('socket.io')(server);
//app.use(express.static(path.join(__dirname, '/public')));
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
@giobauermeister
giobauermeister / iro.min.js
Created November 6, 2017 18:33
a javascript color picker
/*!
* iro.js v3.0.0
* 2016-2017 James Daniel
* Released under the MIT license
* github.com/jaames/iro.js
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.iro=e():t.iro=e()}(this,function(){return function(t){function e(s){if(r[s])return r[s].exports;var n=r[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,s){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var r=t&&t.t?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e,r){"use strict";function s(t){var e,r,s,n,i,o,a,c,h=t.h/360,u=t.s/100,l=t.v/100;switch(n=w(6*h),i=6*h-n,o=l*(1-u),a=l*(1-i*u),c=l*(1-(1-i)*u),n%6){case 0:e=l,r=c,s=o;break;case 1:e=a,r=l,s=o;break;case 2:
#!/usr/bin/env python
# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env python
# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#