This file contains 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
/* | |
* Arduino Gateway SMS | |
* Version 1.0 Jul, 2013 | |
* Copyright 2013 Renato Tavares | |
* | |
* Modified by Renato Tavares <dr.renatotavares@gmail.com> to support ethernet shield and GPRS Shield. | |
* | |
* Complete Web Server to sending SMS with Arduino. | |
*/ |
This file contains 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 <SD.h> | |
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <SoftwareSerial.h> | |
// Define as variáveis para simular o multitasking | |
unsigned long UpdateCycle = 30000; | |
unsigned long UpdateLastMillis = 0; | |
// Ponteiro para o meu arquivo no SD Card |
This file contains 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
void UpdateNoIP(){ | |
EthernetClient client; | |
if(client.connect("dynupdate.no-ip.com", 80)){ | |
Serial.println("Conectando com No-IP"); | |
client.println("GET /nic/update?hostname=SUA URL HTTP/1.0"); | |
client.println("Host: dynupdate.no-ip.com"); | |
client.println("Authorization: Basic Senha em Base64"); | |
client.println("User-Agent: Arduino Client/1.0 dr.renatotavares@gmail.com"); | |
client.println(); |
This file contains 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
//Serial Relay - Arduino will patch a | |
//serial link between the computer and the GPRS Shield | |
//at 19200 bps 8-N-1 | |
//Computer is connected to Hardware UART | |
//GPRS Shield is connected to the Software UART | |
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(2, 3); | |
This file contains 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 "file.h" | |
/** | |
* Cria um arquivo binário com a extensão .dat | |
* de forma segura. A função verifica a existência | |
* do arquivo antes de tentar criá-lo, assim evita | |
* a sobrescrita de dados. | |
* | |
* @param char *file string com o nome do arquivo que você quer criar. | |
* |
This file contains 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
// Defining the constants present in the code | |
unsigned long cycle = 300000; | |
unsigned long lastMillis = 0; | |
void setup(){} | |
void loop(){ | |
if(cycleCheck(&lastMillis, cycle)) { |
This file contains 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 | |
$subject = 'Assunto'; | |
$from = 'fulano@gmail.com'; | |
$to = 'ciclano@hotmail.com'; | |
$bcc = null; // Esconder endereços de e-mails. | |
$cc = null; // Qualquer destinatário pode ver os endereços de e-mail especificados nos campos To e Cc. | |
$message = 'Corpo da mensagem'; | |
$headers = sprintf( 'Date: %s%s', date( "D, d M Y H:i:s O" ), PHP_EOL ); |
This file contains 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 "file.h" | |
/** | |
* Cria um arquivo binário com a extensão .dat de forma segura. | |
* A função verifica a existência do arquivo antes de tentar criá-lo, | |
* assim evita a sobrescrita de dados. | |
* | |
* @param char *file string com o nome do arquivo que você quer criar. | |
* @return void | |
* |
This file contains 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
// lista arquivos no diretorio | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
int main(void) | |
{ | |
DIR *dir; | |
struct dirent *lsdir; |
This file contains 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 time | |
serials = {"COM1": "idle", "COM2": "idle"} | |
class Teste(object): | |
def getIdle(self): | |
for port in serials: | |
if serials[port] == 'idle': |
OlderNewer