Created
February 3, 2019 21:41
-
-
Save sabas1080/997a113dd2c4e550da255703c1fa65bb to your computer and use it in GitHub Desktop.
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
/************************************************************ | |
Especial para SORIA FEBRERO 2019 | |
SPANISH | |
Ground station | |
Ground station - Estacion Terrena para CatSat | |
Eduardo Contreras @ Electronic Cats | |
Original Creation Date: Oct 8, 2018 | |
https://github.com/ElectronicCats/CatSatZero | |
Este ejemplo demuestra el funcionamiento basico de la estacion terrena | |
la cual filtra los Satelites | |
http://electroniccats.com | |
Especificaciones del entorno de Desarrollo: | |
IDE: Arduino 1.8.4 | |
Plataforma de Hardware: | |
Estacion terrena CanSat Zero | |
- USB Stick CatWAN | |
Este código es beerware si tu me ves ( o cualquier otro miembro de Electronic Cats) | |
a nivel local, y tu has encontrado nuestro código útil , | |
por favor comprar una ronda de cervezas! | |
Distribuido como; no se da ninguna garantía. | |
************************************************************/ | |
/************************************************************ | |
ENGLISH | |
Ground Station | |
Ground Station - Ground-Station for CatSat | |
Eduardo contreras @ Electronic Cats | |
Original Creation Date: Oct 8, 2018 | |
https://github.com/ElectronicCats/CatSatZero | |
http://electroniccats.com | |
This example demonstrates how to use the ground-station for CatSat | |
Development environment specifics: | |
IDE: Arduino 1.8.4 | |
Hardware Platform: | |
Kit CanSat Zero | |
- USB Stick CatWAN | |
This code is beerware; if you see me (or any other Electronic Cats | |
member) at the local, and you've found our code helpful, | |
please buy us a round! | |
Distributed as-is; no warranty is given. | |
********************************************************** | |
*IMPORTANTE CAMBIA TU ID DEPENDIENDO DE TU CANSAT * | |
**********************************************************/ | |
#include <SPI.h> | |
#include <LoRa.h> | |
/************************************************************ | |
* IMPORTANTE CAMBIAR id_node DEPENDIENDO TU CANSAT * | |
************************************************************/ | |
String ID = "Sat1"; | |
/******************************************************* | |
*Selecciona un canal entre 0 y 12 este debe coincidir * | |
*con el canal de tu satelite * | |
*******************************************************/ | |
int channel = 12; | |
String buff; | |
//For other device | |
#define RFM95_CS 10 | |
#define RFM95_RST 9 | |
#define RFM95_INT 2 | |
long selectBand(int); | |
void setup() | |
{ | |
Serial.begin(9600); | |
while (!Serial); | |
pinMode(LED_BUILTIN,OUTPUT); | |
Serial.println("LoRa Receiver"); | |
//Re-write pins CS, reset, y IRQ for other device | |
// LoRa.setPins(RFM95_CS, RFM95_RST, RFM95_INT); // CS, reset, int pin | |
//Re-write pins CS, reset, y IRQ for CatWAN USB Stick Electronic Cats | |
//LoRa.setPins(SS, RFM_RST, RFM_DIO0); | |
if (!LoRa.begin(868E6)) { | |
Serial.println("Starting LoRa failed!"); | |
while (1); | |
} | |
LoRa.setTxPower(17); //Set the max transmition power | |
LoRa.setSpreadingFactor(12); //Change the SF to get longer distances | |
} | |
void loop() | |
{ | |
int packetSize = LoRa.parsePacket(); | |
if (packetSize) { | |
digitalWrite(LED_BUILTIN,HIGH); | |
// read packet | |
while (LoRa.available()) { | |
buff+=(char)LoRa.read(); | |
} | |
buff+=","; | |
buff+=String(LoRa.packetRssi()); | |
Serial.println(buff); | |
buff=""; | |
digitalWrite(LED_BUILTIN,LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment