Help with a monitor Arduino.

So for my very first arduino project I want to make an arduino that displays free ram, cpu in use, cpu temp, and gpu temp. Can this be done with Arduino Uno, and a LCDx2 and if so can anyone give me the code I would need to do what I've described?
Thanks.

gpu

?

There's no gpu on an Arduino.

I think he means to display PC stats.

But yes, that's possible with an Arduino. BUT, the hardest part is the PC part... (aka, not related to Arduino) That's where you have gather the info. After that it's just a matter of sending it to the Arduino via serial and displaying it.

septillion:
I think he means to display PC stats.

But yes, that's possible with an Arduino. BUT, the hardest part is the PC part... (aka, not related to Arduino) That's where you have gather the info. After that it's just a matter of sending it to the Arduino via serial and displaying it.

Well yeah. I figure that'd be obvious.
But does anyone have the code I'd need?

I found this for the CPU and RAM usage:

#include <LiquidCrystal.h>

//Set's lcd to the Arduino's ports
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
lcd.begin(16, 2);
Serial.begin(9600);

}

void loop() {

String content = "";
char character;

while(Serial.available()) {
character = Serial.read();
content.concat(character);
}

if (content != "") {

if (content == "`") {
content = "";
lcd.setCursor(0,1);
}

if (content == "*") {
content = "";
lcd.setCursor(0,0);
}

Serial.println(content);
lcd.print(content);
}

if (content == "~") {
lcd.clear();
}

}

And this for the Temps:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F,16,2);
String inData;

void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
}

void loop() {

while (Serial.available() > 0)
{
char recieved = Serial.read();
inData += recieved;

if (recieved == '*')
{
inData.remove(inData.length() - 1, 1);
lcd.setCursor(0,0);
lcd.print("GPU Temp.: " + inData + char(223)+"C ");
inData = "";

if(inData == "DIS")
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Disconnected!");
}
}

if (recieved == '#')
{
inData.remove(inData.length() - 1, 1);
lcd.setCursor(0,1);
lcd.print("CPU Temp.: " + inData + char(223)+"C ");
inData = "";
}
}
}

How can I throw them together and if I can, can I get all 4 readings to appear on the same LED?

Yes, but that code assumes that you also have some program running on the computer that is sending those values. If that's how you want to do it, I'd suggest reading the serial input basics thread and work from there. You'll also need to write the code to run on the PC to match it unless you can find an example somewhere that is already done and has both codes AND works on your particular environment.

Please read How to use the forum and go back and edit your post to include code-tags please.

Like I said, showing data on a screen with the Arduino is the easy part. The hardest part is writing an app to get the data on the pc. And that's not Arduino related.

This is a forum for helping people (learn) to program, not to write programs or change random snippets found online. Like Delta_G said, that snippet falls or breaks with the corresponding PC program.

Alright so I know that both portion of the program need a program to run properly and I've found both.
If I was to combine the codes where would I start?

TheLastGrandPatriot:
Alright so I know that both portion of the program need a program to run properly and I've found both.
If I was to combine the codes where would I start?

Often the "First Project" is the scope of a senior project.
Instead, consider your first project be displaying 4 values on an LCD. Don't worry about where the values come from and how to modify someone's code. simply learn:
A) what is an LCDx2?
B) is there a library to drive it?
C) what are the function calls and syntax of that library?
D) what are the capabilities and limits of this LCDx2?
If we assume it's a LiquidCrystal compatible LCD such as, this one or that one, we have to understand the library functions, LCD properties etc. This will help us figure out how we want to arrange the 4 values on the screen.

If they come from the same source / are meant to function together, just run them. (But that's not called programming...)

If you just found random snippets, study them (and hopefully the comments) and understand what they do. When you know, start programming :slight_smile:

PS Where are those two programs?
PSS Just finding two random pieces of code and asking how to "make them work" isn't programming and isn't what the forum is for.

Hi,

Can you tell us your electronics, programming, Arduino, hardware experience?

Thanks.. Tom... :slight_smile:

Absolutely none. If I was being completely honest this is a project for a programming for engineers course that had a week long section on C++ that taught anybody with no prior knowledge absolutely nothing. Almost feels like there was a whole line of pre-reqs I for some reason got to skip.
In summation all but one female computer science major in that class are up shit creek without a paddle.
Either way it's imperative that the project work. The time to "learn" has come and passed.
What I want is for someone to either help me figure out how to fuse both portions of code and get all 4 read outs on an LCD, or point me somewhere where I might be able to get help. It's that simple.

You could start by giving up both.... ::slight_smile:

TheLastGrandPatriot:
Absolutely none. If I was being completely honest this is a project for a programming for engineers course that had a week long section on C++ that taught anybody with no prior knowledge absolutely nothing. Almost feels like there was a whole line of pre-reqs I for some reason got to skip.
In summation all but one female computer science major in that class are up shit creek without a paddle.
Either way it's imperative that the project work. The time to "learn" has come and passed.
What I want is for someone to either help me figure out how to fuse both portions of code and get all 4 read outs on an LCD, or point me somewhere where I might be able to get help. It's that simple.

Ok, so, you have one code based on LiquidCrystal.h and one code based on LiquidCrystal_I2C.h.
one code is for one type of LCD and the other for another type of LCD, so first, you have to pick which type of LCD you will use in your project, then mod the one code to look like the code for the LCD you will use.
Both of these LCDs are character matrices, meaning you have x by y characters, 16 columns and 2 rows, for example on the LiquidCrystal based LCD. I might lean to this one, as it's the official Arduino type with code examples, tutorials and support, but if you go the other way, there may be support for it also, wherever you found it.
Assuming you are going with a LiquidCrystal based LCD, and you want 4 values to show on a 16 x 2 character matrix, you will want to put one value at cursor position 0,0, one at 8,0, one at 0,1 and one at 8,1
so, you use a LiquidCrystal command, setCursor() to move the cursor to the position before a lcd.print() command, assuming you've called your instance lcd...
If this doesn't help you, consider that many of the forum posters do freelance work for a fee.