Показометр
Добавлено: 20.05.2016{, 19:45}
Наткнулся в интернете на статью о показометре загрузке CPU и RAM компьютера http://cxem.net/comp/comp130.php . Скачал программу для компьютера- она отправляет данные о загрузке системы в ком прорт. Вроде нечего сложного. Пытался считать adrduino, перебробывал разные регистры через flprog- безрезультатно. Подскажите как получить переменные отправляемые данной программой?
Добавлено (20.05.2016, 19:45)
---------------------------------------------
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
char a[1];
long b = 0;
int last_out=0;
int count;
int error;
int message;
int out,int_tone;
String array[1];
String array_2;
boolean End, minus = 0;
void setup(){
lcd.createChar(1, slash_up);
lcd.createChar(2, slash_down);
lcd.createChar(3, eror);
lcd.createChar(4, light);
lcd.createChar(5, sound);
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("CPU1");
lcd.setCursor(0,1);
lcd.print("CPU2");
lcd.setCursor(11,0);
lcd.print("RAM");}
void loop() {
if(Serial.available()){
delay(2);
a[0] = Serial.read();
if (a[0]=='a'){lcd.setCursor(5,0); lcd.print(" \1 "); lcd.setCursor(5,0);}
if (a[0]=='b'){lcd.setCursor(5,1); lcd.print(" \2 "); lcd.setCursor(5,1);}
if (a[0]=='r'){lcd.setCursor(11,1); lcd.print(" "); lcd.setCursor(11,1); error=1;}
if (a[0]=='s'){message=1;}
if (a[0]=='n'){message=2;}
b *= 10;
b = b + atoi(a);
if (message==1){lcd.setCursor(15,0); lcd.print("\5"); int_tone=1;}
if (message==2){lcd.setCursor(15,0); lcd.print(" "); int_tone=0;}
End = 1;
noTone(7);}
else if(End == 1){
int out=b;
out=out-100;
if (out<0){
lcd.print(last_out);
lcd.print("%");}
else{
lcd.print(out);
lcd.print("%");
last_out=out;}
if (error==1){
if (out>70){
if (int_tone==1){
tone (7,500);}
lcd.setCursor(15,1);
lcd.print("\3");
}}
else if (error==0){lcd.setCursor(15,1); lcd.print(" ");}
error=0;
b = 0;
minus = 0;
End = 0;
message = 0;
delay(100);}
}
Где ее искать переменную? Все перепробовал
Добавлено (20.05.2016, 19:45)
---------------------------------------------
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
char a[1];
long b = 0;
int last_out=0;
int count;
int error;
int message;
int out,int_tone;
String array[1];
String array_2;
boolean End, minus = 0;
void setup(){
lcd.createChar(1, slash_up);
lcd.createChar(2, slash_down);
lcd.createChar(3, eror);
lcd.createChar(4, light);
lcd.createChar(5, sound);
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("CPU1");
lcd.setCursor(0,1);
lcd.print("CPU2");
lcd.setCursor(11,0);
lcd.print("RAM");}
void loop() {
if(Serial.available()){
delay(2);
a[0] = Serial.read();
if (a[0]=='a'){lcd.setCursor(5,0); lcd.print(" \1 "); lcd.setCursor(5,0);}
if (a[0]=='b'){lcd.setCursor(5,1); lcd.print(" \2 "); lcd.setCursor(5,1);}
if (a[0]=='r'){lcd.setCursor(11,1); lcd.print(" "); lcd.setCursor(11,1); error=1;}
if (a[0]=='s'){message=1;}
if (a[0]=='n'){message=2;}
b *= 10;
b = b + atoi(a);
if (message==1){lcd.setCursor(15,0); lcd.print("\5"); int_tone=1;}
if (message==2){lcd.setCursor(15,0); lcd.print(" "); int_tone=0;}
End = 1;
noTone(7);}
else if(End == 1){
int out=b;
out=out-100;
if (out<0){
lcd.print(last_out);
lcd.print("%");}
else{
lcd.print(out);
lcd.print("%");
last_out=out;}
if (error==1){
if (out>70){
if (int_tone==1){
tone (7,500);}
lcd.setCursor(15,1);
lcd.print("\3");
}}
else if (error==0){lcd.setCursor(15,1); lcd.print(" ");}
error=0;
b = 0;
minus = 0;
End = 0;
message = 0;
delay(100);}
}
Где ее искать переменную? Все перепробовал