3/19/2024 0 Comments Hardware monitor pc![]() ![]() Note: Before the firmware will build, you must copy /include/lv_conf.h to /.pio's libdeps subfolder for your project or it will not build. That's all the relevant application code. Hardware.HardwareType = HardwareType.GpuNvidia) If (hardware.HardwareType = HardwareType.GpuAti || If (sensor.SensorType = SensorType.Temperature &ĬpuTemp = () Įlse if (sensor.SensorType = SensorType.Load &ĬpuUsage = () Įlse if (sensor.SensorType = SensorType.Clock &ĬpuSpeed = () If (hardware.HardwareType = HardwareType.CPU)įoreach ( var sensor in hardware.Sensors) If it's not, we move to the previous COM port in the list:įoreach ( var hardware in _computer.Hardware) What we do is we start at the last available COM port - which is probably the most recent connection - and open them in turn to see if they are available. We just enumerate them and add them to the combo. There's another aspect of the serial communication and that is getting the list of COM ports. Plus if this code ever gets reused somewhere else, it will handle all scenarios. NET framework application but it's basically instinct for me at this point. That wasn't necessary due to this being a traditional Windows. You can see aside from what we already covered, that this will also handle big endian systems. } else if(( char)cha= ' ba = BitConverter.GetBytes(cpuSpeed) Var ba = BitConverter.GetBytes(cpuUsage) Private void _port_DataReceived( object sender, SerialDataReceivedEventArgs e) Here's the meat of the serial communication on the PC end: The reason for that is when the T-Display starts up, it will spit unrelated spew to the serial port - a post message basically. If it finds something other than that, it just reads all the waiting data. If it finds it sends the CPU and GPU frequencies. ![]() When it finds '#', it sends four floats containing the CPU use and temp, and the GPU use and temp. Initially, the code listens for a '#' or coming in off the serial port by hooking SerialPort.DataReceived. Meanwhile, every 10 th of a second, it's updating member variables that contain various statistics about the PC's hardware. As soon as the COM port is chosen, it will begin listening for the T-Display. The application isn't currently very robust in that regard, and could be improved, but is more than adequate to prove this concept and illustrate it. The PC application is a single form with a couple of controls to choose the COM port. It periodically requests data over the serial port and then updates the display at most once every 10 th of a second. The T-Display uses LVGL to handle the graphics. The PC application uses Open Hardware Monitor to gather information about the CPU and GPU every 10 th of a second, and it uses a serial port to relay that information to a connected T-Display periodically, as the T-Display requests it. There are two projects involved here: The T-Display firmware and the PC application. It assumes Visual Studio 2019 or better and the. It assumes you are running Windows 10 or 11 and have admin access on that system. It assumes PlatformIO, although you can use the Arduino IDE with some prep work and adaptation, mostly renaming and/or moving files around. ![]() This project assumes you have a T-Display S3, or are willing to adapt the code to a separate device. You can use the buttons on it to switch between usage/temperature and frequency. It reads data about your PC from the serial port using a companion application on the PC. I wanted more than just an audible cue, and I really don't like obscuring the game screen with overlays, so I whipped out my little T-Display S3 and made this: Finally, I started to hear the card spin up and actually sweat a little. Well, eventually I got a 2080ti so I could play it in 4K, and it did so easily, so I decided to throw some tough computations at it by adding heavy forest all over the landscape. It's an endlessly expandable game so I keep coming back to it even after 7 years of play. Download firmware - 20.6 KB (or Github).Download application - 137.1 KB (or Github). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |