Hi everyone, I need to send two analog data (potentiometer), but I have problems when I send to chirpStack.
This is a example only in the arduino ide, its ok, works.
// I use the device LoRa 32 V2 915 Mhz
/* pins 25 and 37 I will use to read the data that i need to send*/
#define AnPin1 25//to read the analog potenciometer
#define AnPin2 37//to read the analog potenciometer
int val1, val2;
/I think that the value that I want to send through lora must be string, this is the reason text1 and text2/
String text1 ="";
String text2 ="";
void setup()
{
Serial.begin(115200);
Serial.setTimeout(50);
}
void loop()
{
val1 = analogRead(AnPin1);
val2 = analogRead(AnPin2);
text1 = (String)val1;
text2 = (String)val2;
/* I made this part to probe that val1 was convert to string, not problem val1 is a string */
if (text1 == “55” or text1 == “47” or text1 == “59” or text1 == “25” ){
Serial.println(“Hi, text1 is a string”);
}
//here I should send to chirpstack
Serial.println(text1);
Serial.println(text2);
Serial.println();
delay(1000);
}
Can you help me please to do the same with chirpstack.
I’m using the DHT11 example, but i don’t know what method I must use to send some values to the chirpstack. Please help me.