summaryrefslogtreecommitdiff
path: root/trunk/darwin/electronics/Arduino-Sanguino/motherboard/rs485_tester/rs485_tester.pde
blob: 6840893b6026a6344f1dd84eb04008c52ab8d915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#define RX_ENABLE_PIN   13
#define TX_ENABLE_PIN   12
#define DEBUG_PIN 0

void setup()
{
 pinMode(RX_ENABLE_PIN, OUTPUT);
 pinMode(TX_ENABLE_PIN, OUTPUT);
 pinMode(DEBUG_PIN, OUTPUT);

  digitalWrite(TX_ENABLE_PIN, HIGH); //enable tx
  digitalWrite(RX_ENABLE_PIN, LOW); //enable rx
  digitalWrite(DEBUG_PIN, LOW); //disable led

  Serial.begin(9600);
  Serial.println("started");
  
  Serial1.begin(9600);
  Serial1.println("hello?");

  if (Serial1.available() > 0)
  {
    digitalWrite(DEBUG_PIN, HIGH);
    Serial.println("RS485 active.");
  }
}

void loop()
{
}