Hi,
I have already created a connection trough RS485 to the Anemometer.
I can read the parameters it sends when it starts up.
Now I need to send a command and than listen to the response.
Example:
Command: 00KY00001
Responce: !00KY00001
Command 2: 00ID00004
Responce 2: !04ID00004
...
...
How do i go about this?
Can i find some example code?
Thanks in advance
There are hundreds of anemometers. Please provide a data sheet (not a picture) for the anemometer and how it is connected to the Arduino. Which Arduino? The code that you have, so far, would be helpful as well.
Hi,
Its the following Anemometer:
You can find the connection in the attachment. I use A MAX485E chip.
https://datasheets.maximintegrated.com/en/ds/MAX1487E-MAX491E.pdf
I don't have a lot yet but here's the code i have that works to read info from the sensor.
#define LED_PIN 13
#define controlpin 3
char inputVal;
void setup() {
Serial.begin(9600);
pinMode(LED_PIN, OUTPUT);
pinMode(controlpin, OUTPUT);
Serial.println("Init() complete");
}
void loop() {
if (Serial.available() > 0) {
digitalWrite(LED_PIN, LOW);
inputVal = Serial.read();
Serial.print(inputVal); // print als ASCII-encoded tekst
delay(10);
digitalWrite(LED_PIN, HIGH);
}
}
Thanks in advance