gica do inversor tem uma resolução de apenas 7 bits, ou seja, consegue discriminar 128 níveis (2^7). Na escala de 0 - 10 V temos uma resolução de 78 mV que correspondem em passos de 0,47 Hz. Se usar apenas entre 0 - 5 V temos 64 passos de 0,94 Hz.
Para a maioria dos sistemas isso não seria problema, mas para outros sim, vai depender das particularidades do sistema.
Abraços.…
Adicionado por Wiechert ao 18:39 em 23 setembro 2013
divisor de tensão que vc sentiu falta
3. RX e TX nos pinos 0 e 1 (sem softwareserial.h)
4. Com led + resistor em outros pinos que não o 13.
5 Com alimentação externa (fonte de 1A).
6. Mudando a velocidade de 9600 até 115200.
7. Mudando a alimentação para 3,3V.
8. Outros sketches mas com mesma filosofia.
enfim.........
Obrigado…
or serial valores de 7 em sete, a cada segundo e não de um.
Quando executei ele fez assim
0
1
2
3
4
5
6
7
pausa de 1 segundo
8
9
10
11
12
13
14
pausa de 1 segundo
... E POR AI EM DIANTE.
Quando ele deveria aparecer assim:
0
pausa de 1 segundo
1
pausa de 1 segundo
2
pausa de 1 segundo
e por ai vai....
Mas valeu, vamos continuar tentando....
…
Adicionado por Weider Duarte ao 14:52 em 30 outubro 2017
ss ip(192,168,1,122); // alterar IP do vosso RouterIPAddress gateway(192, 168, 1, 1);IPAddress subnet(255, 255, 255, 0);EthernetServer server(82);
void setup(){ Serial.begin(9600); pinMode(rele1, OUTPUT); pinMode(rele2, OUTPUT); SPI.begin(); Ethernet.begin(mac, ip, gateway, subnet); server.begin();} void loop(){ char valorlido = Serial.read(); if (valorlido == 'a') {digitalWrite(rele1, HIGH); Serial.println("Rele 1 Ligado");} if (valorlido == 'b') {digitalWrite(rele1, LOW); Serial.println("Rele 1 Apagado");} if (valorlido == 'c') {digitalWrite(rele2, HIGH); Serial.println("Rele 2 Ligado");} if (valorlido == 'd') {digitalWrite(rele2, LOW); Serial.println("Rele 2 Apagado");} EthernetClient client = server.available(); if (client) { String vars1; while (client.connected()) if (client.available()) {char c = client.read(); vars1.concat(c); if (vars1.endsWith("/1on")) varOnOff1 = 1; else if(vars1.endsWith("/1off")) varOnOff1 = 2; if(varOnOff1 == 1) digitalWrite(rele1, HIGH); else if (varOnOff1 == 2) digitalWrite(rele1, LOW); if (vars1.endsWith("/2on")) varOnOff1 = 3; else if(vars1.endsWith("/2off")) varOnOff1 = 4; if(varOnOff1 == 3) digitalWrite(rele2, HIGH); else if (varOnOff1 == 4) digitalWrite(rele2, LOW); } }}
Dá para ligar 2 relés pelas portas 6 e 7 do Arduino através de internet e shield Bluetooth.
Para bluetooth:
Instalar bluetooh no telemóvel e ligar (password: 1234)
a - liga relé 1
b - apaga relé 1
c - liga relé 2
d - apaga relé 2
Para Internet:
Criar um IP através de DYNDNS.org.
Abrir a porta 82 (ou outra à escolha) no router.
Digitar: exemplo.dyndns.org/1on para ligar relé 1
exemplo.dyndns.org/1off para apagar relé 1
exemplo.dyndns.org/2on para ligar relé 2
exemplo.dyndns.org/2off para apagar relé 2
Espero que ajude alguém!!!!!…
Adicionado por Mário Ventura ao 10:39 em 29 janeiro 2014
0, 1, 2, 3, 4, 6, 7, 16 Teensy 2.0: 5, 6, 7, 8 Teensy++ 1.0: 0, 1, 2, 3, 18, 19, 36, 37 Teensy++ 2.0: 0, 1, 2, 3, 18, 19, 36, 37 Sanguino: 2, 10, 11
for more information you can read the original wiki in arduino.cc at http://www.arduino.cc/playground/Main/PS2Keyboard or http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
Like the Original library and example this is under LGPL license.
Modified by Cuninganreset@gmail.com on 2010-03-22 Modified by Paul Stoffregen <paul@pjrc.com> June 2010*/
#include const int DataPin = 8;const int IRQpin = 5;
PS2Keyboard keyboard;
void setup() { delay(1000); keyboard.begin(DataPin, IRQpin); Serial.begin(9600); Serial.println("Keyboard Test:");}
void loop() { if (keyboard.available()) {
// read the next key char c = keyboard.read();
// check for some of the special keys if (c == PS2_ENTER) { Serial.println(); } else if (c == PS2_TAB) { Serial.print("[Tab]"); } else if (c == PS2_ESC) { Serial.print("[ESC]"); } else if (c == PS2_PAGEDOWN) { Serial.print("[PgDn]"); } else if (c == PS2_PAGEUP) { Serial.print("[PgUp]"); } else if (c == PS2_LEFTARROW) { Serial.print("[Left]"); } else if (c == PS2_RIGHTARROW) { Serial.print("[Right]"); } else if (c == PS2_UPARROW) { Serial.print("[Up]"); } else if (c == PS2_DOWNARROW) { Serial.print("[Down]"); } else if (c == PS2_DELETE) { Serial.print("[Del]"); } else {
// otherwise, just print all normal characters Serial.print(c); } }}
----- ele digita os codigos no arduino conforme agente vai apertando qualquer tecla as linhas de testes acima…
Adicionado por Fabio Cimino ao 23:35 em 13 janeiro 2013