- This topic has 1 reply, 2 voices, and was last updated 2 years, 1 month ago by .
Viewing 1 reply thread
	
Viewing 1 reply thread
	
- You must be logged in to reply to this topic.
Home › Forums › The libraries hosted on the site › EByte LoRa e32 UART devices sx1262/sx1268 › E32 Shield on E220 | Help
Hello, I have bought the shield that you sell for the E32 EBYTE, but I am using it with an E220, I am modifying the basic code so that it receives and sends simple messages, but I cannot do it, I attach the code.
#include “Arduino.h”
#include “LoRa_E220.h”
LoRa_E220 e220ttl100(3, 4); // e32 TX e32 RX
void setup() {
  Serial.begin(9600);
  delay(500);
Serial.println(“Hi, I’m going to send message!”);
  // Startup all pins and UART
  e220ttl100.begin();
  // Send message
  ResponseStatus rs = e220ttl100.sendMessage(“Hello, world?”);
  // Check If there is some problem of successfully send
  Serial.println(rs.getResponseDescription());
}
void loop() {
    // If something available
  if (e220ttl100.available()>1) {
      // read the String message
    ResponseContainer rc = e220ttl100.receiveMessage();
    // Is something goes wrong print error
    if (rc.status.code!=1){
        rc.status.getResponseDescription();
    }else{
        // Print the data received
        Serial.println(rc.data);
    }
  }
  if (Serial.available()) {
      String input = Serial.readString();
      e220ttl100.sendMessage(input);
  }
}
Hi Giuseppe,
I don’t know which shield you buy, but you can go to the article on the relative shield and get the constructor.
Bye Renzo
More
 
 
  
 


 

