I have a very simple Arduino sketch that sends some text every second using Serial.println(). Uploading, running and viewing the output on the Serial Monitor works for both an Arduino UNO and this ProMicro board. In both cases the sending LED on the UNO/ProMicro blinks and the text is displayed on the Serial Monitor every second. Everything is beautiful in the world!
Now, I have both the UNO and ProMicro boards loaded with the application and the Arduino IDE is closed.
I also have a simple C#.NET application that connects to a serial port and reads and displays anything coming over the port.
If I plug in the Arduino UNO board with the USB cable and then start the C# program the program immediately hooks up and the text from the UNO starts displaying from the C# program as I would expect and, again, the sending LED is blinking in sync with the sent Serial.println() calls.
…when using the ProMicro, I have a problem. Hooking up the USB and then starting the C# program, it doesn’t work. Stepping through in the Visual Studio debugger, it successfully opens the port and calls the first ReadLine() and then blocks. Also the ProMicro send LED does not blink. I’ve attached both the sketch and C# program.
Since the output works on both boards with the Arduino IDE, and it works with the UNO with the C# program, I feel like it must be some other configuration or handshaking or something that the ProMicro needs in addition, but I don’t know what to try next.
I'm hoping it’s something obvious to someone here.
Thanks for any help.
- Code: Select all
int VERSION = 1;
int SAMPLE_MS = 1000;
Serial.print("DAB Start Version,");
// We're using a single character to signify something to do.
char c = (char)Serial.read();
return GetCyclic(15.0, 27.0, 101);
return GetCyclic(40.0, 50.0, 60);
float GetCyclic(float fMin, float fMax, int samplesPerPeriod)
static int last = 0;
float rad = last * 6.283185 / samplesPerPeriod;
double rtn = (sin(rad) * (fMax - fMin) + fMax + fMin) / 2.0;
- Code: Select all
static void Main()
SerialPort _sp = new SerialPort();
_sp.PortName = "COM5";
_sp.BaudRate = 9600;
_sp.Parity = Parity.None;
_sp.DataBits = 8;
_sp.StopBits = StopBits.One;
_sp.Handshake = Handshake.None;
string message = _sp.ReadLine();