Hello guys, i am currently working on PC cpu and free ram monitoring and i found the code for monitoring. And the code is: typeperf "\Memory\Available bytes" "\processor(_total)% processor time"
code's output is this; 07/30/2014 00:34:07.610","4949762048.000000","2.309958"
i want to get this output and remove these time stamps then print this free ram and % cpu usage to the LCD screen. Can you help me how can i get this output back from the system(); command. Thank you in advance.
Are you trying to say that you want to get some data from a PC and send it to an Arduino so that the Arduino can display the data on an LCD display?
If so the demo here shows how to send data from a PC to an Arduino using Python on the PC. You just need to modify the Python code to collect the data you want and modify the Arduino program to use an LCD.
Robin2:
Are you trying to say that you want to get some data from a PC and send it to an Arduino so that the Arduino can display the data on an LCD display?
If so the demo here shows how to send data from a PC to an Arduino using Python on the PC. You just need to modify the Python code to collect the data you want and modify the Arduino program to use an LCD.
...R
Yes i want to take free RAM and % cpu usage and print it to the LCD. But i could not get the idea behind Python. My main code is this: typeperf "\Memory\Available bytes" "\processor(_total)% processor time" it gives me the free ram and % cpu usage in cmd window but how can i get back the data i couldnt get it. Please help me
You can use the programming language of your choice to read the system status and send it to an Arduino. The InterfacingWithSoftware page lists examples for just about every language under the sun.
I'm pretty sure you can get Python to issue system commands and receive and process the response. Learning how to do that will usefully broaden your experience. There are probably thousands of websites with Python advice.
What Arduino are you using? If you're trying to get metrics back from the PC via the USB serial connection, what operating system is running on the PC? If you aren't trying to do that, please explain what you're trying to do.
PeterH:
What Arduino are you using? If you're trying to get metrics back from the PC via the USB serial connection, what operating system is running on the PC? If you aren't trying to do that, please explain what you're trying to do.
I am using Uno R3, I want to collect CPU Usage, Used RAM, CPU and GPU Temperatures and send it to the LCD connected to the arduino though the serial port. My operating system is Windows. So far i did this;
Imports System
Imports System.Management
Imports System.Runtime.InteropServices
Public Class Form1
Public Enum TempFormat
Fahrenheit
Celsius
Kelvin
Raw
End Enum
Public Declare Function NvCplGetThermalSettings Lib "nvcpl.dll" (ByVal windowsMonitorNumber As UInt32, _
ByRef coreTemp As UInt32, ByRef ambientTemp As UInt32, ByRef upperLimit As UInt32) As Boolean
Private Property usedram As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = Enabled
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = "CPU kullan?m?: " + ProgressBar1.Value.ToString + "%"
ProgressBar1.Value = PerformanceCounter1.NextValue.ToString
Dim dblAns As Double
dblAns = (My.Computer.Info.TotalPhysicalMemory.ToString / 1024) / 1024
usedram = Format(dblAns, "###,###,##0") - PerformanceCounter2.NextValue
Label2.Text = usedram.ToString + " MB"
usedram = PerformanceCounter3.NextValue
ProgressBar2.Value = usedram.ToString
End Sub
End Class
I am currently making it just visual on a form. When im finished i will transfer data with serial port. My CPU Usage and Ram usage is working well but just CPU and GPU temperatures are too hard work for me please help about two.
Try
Dim searcher As New ManagementObjectSearcher("root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature")
For Each queryObj As ManagementObject In searcher.Get()
Dim temp As Double = CDbl(queryObj("CurrentTemperature"))
temp = (temp - 2732) / 10.0
MessageBox.Show(temp.ToString)
Next
Catch ex As ManagementException
MessageBox.Show(ex.Message)
End Try
I have tryed this code but it gives me same results all the time.