Meta | Nome | Função |
---|---|---|
. |
ponto | um caractere qualquer |
[] |
conjunto | conjunto de caracteres permitidos |
[^] |
conjunto negado | conjunto de caracteres proibidos |
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
import serial | |
import time | |
ser = serial.Serial('/dev/ttyS0', 115200) | |
def toDecimal(some_string): | |
decimals = [ord(c) for c in some_string] | |
return bytes(decimals) | |
#if not ser.isOpen(): |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
///////////////////////////////////////////////////////////////////////////////////////////// | |
//////////////////////////////////////////////////////////////////////////////////////////// | |
// YOUR SESSION ID CONFIGURATION | |
#define ID_MQTT " " | |
//////////////////////////////////////////////////////////////////////////////////////////// |
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
// Realiza um disparo via Ajax para o endereço do meu NodeMcu | |
var led_controle = function(status) { | |
var xmlhttp = new XMLHttpRequest(); | |
var set_status = "http://192.168.0.106/?function=" + status; | |
xmlhttp.open("GET", set_status); | |
xmlhttp.send(); | |
} | |
// Acessa os botões e passando as nossas diretivas de ligar ou desligar o led | |
var led = 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
<a class="buttons ligar">Ligar</a> | |
<a class="buttons desligar">Desligar</a> |
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
#include <ESP8266WiFi.h> | |
// Nome do seu wifi | |
const char* ssid = "seu_wifi_nome"; | |
// Senha do seu wifi | |
const char* password = "senha_do_seu_wifi"; | |
// Porta de comunicacao (normalmente se utiliza a 80 ou 8080) | |
WiFiServer server(80); |
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
<?php | |
$posicoes = $_POST['posicoes']; | |
foreach ($posicoes as $key => $id) { | |
$data['posicao'] = $key; | |
$this->perguntas_enquete->update($data, $id); | |
} | |
?> |
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
<script> | |
$(function() { | |
$( "#my_sortable" ).sortable({ | |
update: function() { | |
var order = $("#my_sortable").sortable('toArray'); | |
$.post("editar_posicao.php", {posicoes: order}) | |
} | |
}); | |
$( "#my_sortable" ).disableSelection(); |
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
<ul id="my_sortable"> | |
<?php foreach ($perguntas as $pergunta):?> | |
<li id="<?php echo $pergunta->id;?>"> | |
<?php echo $pergunta->nome;?> | |
</li> | |
<?php endif;?> | |
</ul> |
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
// Inicializa o Pino enviando pulso elétrico | |
void startPinLeed(int _pinMode) { | |
pinMode(_pinMode, OUTPUT); | |
} | |
/* | |
* blinkLeed | |
* int _pinMode: Numero do pino | |
* int _delay: Tempo de espera para ligar ou desligar o leed | |
*/ |
NewerOlder