We're checking if a port is already open, if not setting timer interval from comboBox2 and run everything up! ToolStripStatusLabel1.Text = "Sending data." Timer1.Interval = Convert.ToInt32(comboBox2.Text) ToolStripStatusLabel1.Text = "Arduino's not responding." If (hardwadre.HardwareType = HardwareType.CPU) If (sensor.SensorType = SensorType.Temperature) If (hardwadre.HardwareType = HardwareType.GpuNvidia)įoreach (var sensor in hardwadre.Sensors) Now major function to store and send variables: private void Status() Initialize declared variables, scan for open ports and add it to the comboBox1 String ports = SerialPort.GetPortNames() I mean in writing)įirst of all, we need to download additional library for easy access to our hardware variables.Īfter unpacking, we have our library: OpenHardwareMonitorLib.dllĬreate new project -> Windows Forms Application -> Right click on References in Solution Explorer -> Browse -> OpenHardwareMonitorLib.dll and don't forget to check it. Why C#, not C or C++ ? C# is easy and fast (fast. When last of char will be # Arduino will set the second line of our LCD and print other data.
![hardware monitor app hardware monitor app](https://http2.mlstatic.com/D_NQ_NP_2X_820822-MLB29328570286_022019-F.jpg)
We need to get rid of this *Ĭhar so: inData.remove(inData.length() - 1, 1) īut. When last of char will be * Arduino will know when to proceed next part, Now we have to handle our message. Ok, everything's fine but when receiving data stop coming? There is solution: if (recieved = '*')
If we would like to send data directly by a string variable it could be problematic, because of about one-second latency based on string size.
HARDWARE MONITOR APP SERIAL
Variable to store our Serial input and setup rest of stuff. Set 16x2 LCD with address 0x3F - address of I2C bus device can be found from scanning via simple sketch available on Arduino Playground.
![hardware monitor app hardware monitor app](https://image.winudf.com/v1/image/Y29tLmRldi5zeXN0ZW0ubW9uaXRvcl9zY3JlZW5fOF9uNWhsaXEwZA/screen-8=x800.jpg)
When we did this, we can move to the next part.