ArduinoGeneral

Can't get APC220 to work

userHead Account cancelled 2020-02-23 06:43:52 1236 Views1 Replies
I'm trying to configure it through Arduino, which should work according to everyone, but isn't.
Code: Select all
#include <SoftwareSerial.h>

//rafaboi

const int rxPin = 0;
const int txPin = 1;
const int setPin = 2;
const int enPin = 3;
const int fiveV = 4;


SoftwareSerial thing(rxPin, txPin);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  thing.begin(9600);
  pinMode(setPin, OUTPUT);
  digitalWrite(setPin, HIGH);
  pinMode(fiveV, OUTPUT);
  digitalWrite(fiveV, HIGH);
  pinMode(enPin, OUTPUT);
  digitalWrite(enPin, HIGH);
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  digitalWrite(setPin, LOW);
  thing.listen();
  thing.println("RD");
  delay(10);
  Serial.println("");
  Serial.println("here we gooo:");
  /*while (thing.available()) {
    Serial.print(thing.read());
  }*/
  Serial.println("done!");
  digitalWrite(setPin, HIGH);

}

void loop() {
  // put your main code here, to run repeatedly:
  if (thing.available() > 0) {
    Serial.print(thing.read());
  }

}
Output is "here we gooo:" "done!". Everything works perfectly, including the LED, but no data is coming from the APC.

Thanks in advance.