I've received a USB to serial adapter from Chine I bought off eBay. I want to test it. I thought it would be easy to use the UNO to do this. I'm using this simple sketch:
int ledPin = 13; // LED connected to digital pin 13
int inPin = 7; // pushbutton connected to digital pin 7
int val = 0; // variable to store the read value
pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output
pinMode(inPin, INPUT); // sets the digital pin 7 as input
val = digitalRead(inPin); // read the input pin
digitalWrite(ledPin, val); // sets the LED to the button's value
So the idea is this:
To test DTR I do the following:
I connect ping 5 (SG) to GND on the UNO.
I connect pin 4 (DTR) to digital pin 7 on the UNO.
If DTR is asserted the LED with light. On the Linux computer I'll use a C program to turn off DTR. This should make the LED go out.
My office is RF noisy so the minute I put a piece of wire (not connected to anything else) into pin 7 the LED lights. Can someone tell me the best way to do this?