Test sketches are now ignored

pull/1/head
Jan Gromeš 2018-03-31 10:14:08 +02:00
rodzic a54d052104
commit 51d236dcc2
3 zmienionych plików z 3 dodań i 92 usunięć

3
.gitignore vendored
Wyświetl plik

@ -33,3 +33,6 @@
# Arduino Library Development file
.development
# Arduino testing sketches
examples/test/

Wyświetl plik

@ -1,68 +0,0 @@
#include "KiteLib.h"
ESP8266 wifi = Kite.ModuleA;
SX1278 lora = Kite.ModuleB;
//HC05 bluetooth = Kite.ModuleB;
Packet pack("01:23:45:67:89:AB:CD:EF", "Hello World! (by LoRa)");
void setup() {
Serial.begin(9600);
Serial.print("[ESP8266] Connecting ... ");
byte state = wifi.begin(9600);
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
}
Serial.print("[ESP8266] Joining AP ... ");
state = wifi.join("SSID", "PASSWORD");
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
}
Serial.print("[ESP8266] Sending GET request ... ");
String response;
int http_code = wifi.HttpGet("http://www.httpbin.org/ip", response);
if(http_code == 200) {
Serial.println("success!");
Serial.println("[ESP8266] Response:\n");
Serial.println(response);
} else {
Serial.print("failed, code 0x");
Serial.println(http_code, HEX);
}
Serial.print("[SX1278] Initializing ... ");
state = lora.begin();
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
}
//bluetooth.begin(9600);
}
void loop() {
Serial.print("[SX1278] Transmitting packet ... ");
byte state = lora.transmit(pack);
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
}
//bluetooth.println("Hello World! (by Blueooth)");
delay(1000);
}

Wyświetl plik

@ -1,24 +0,0 @@
#include <SoftwareSerial.h>
const int RX_A = 9;
const int TX_A = 8;
const int RX_B = 7;
const int TX_B = 6;
SoftwareSerial module(RX_A, TX_A); // Rx, Tx, Module A
//SoftwareSerial module(RX_B, TX_B); // Rx, Tx, Module B
void setup() {
Serial.begin(9600);
module.begin(9600);
}
void loop() {
while(Serial.available() > 0) {
module.write(Serial.read());
}
while(module.available() > 0) {
Serial.write(module.read());
}
}