Étape 2: Partie 3
Partie 3 [produit fini avec le programme]
(Joint sont le fichier txt sur son fonctionnement et le programme)
Je sais que ce projet a certains weakiness encore à être découvert par moi-même ou plus probablement d’autres. Cependant la plupart du temps il montre comment des mesures de tension et la résistance peuvent se faire à l’aide d’un pont de Wheatstone. Permettant d’autres capteurs fonctionner comme une jauge de contrainte, diodes sensibles, capteur de température et bien plus encore.
Pour le logiciel utilisé pour la plupart l’émulation HyperTerminal et VT100J.
Cependant à l’aide de mastic Translation (CP866 taper manuellement dans) avec une police basée OEM et ANSI.
Tous ceux qui souhaitent être de proposer certains * constructive * critique pour rendre le circuit plus précis est la bienvenue.
Est jointe l’esquisse pour le microprocesseur de la carte uno : Voici le code brut :
Démarrer copie ici
#define A0IN 0
#define A1IN 1
int analogamount = 0 ; utilisé pour convertir le pont gauche tension
int analogamount1 = 0 ; utilisé pour convertir les droite pont tension
flotteur de tension = 0 ; tension de pont gauche
float voltage1 = 0 ; tension de droite pont
float voltage2 = 0 ; utilisé pour la correction de la tension
flotteur de réponse = 0 ;
int cv = 0 ; variable de compteur utilisé le dessin de l’écran
void setup() {}
analogReference(EXTERNAL) ; utiliser l’AREF pour tension de référence
Serial.Begin(9600) ;
set_screen() ;
}
void loop() {}
analogamount = analogRead(A0IN) ;
analogamount1 = analogRead(A1IN) ;
tension = analogamount * (4500 / 1024.00) ;
voltage1 = analogamount1 * (4500 / 1024.00) ;
voltage2 = 0 ;
set_xy(23,1) ;
save_cursor_pos() ;
if(voltage == voltage1) {}
set_xy(10,25) ;
repeat_char(10,0x20) ;
set_xy(10,47) ;
repeat_char(10,0x20) ;
set_xy(14,49) ;
repeat_char(10,0x20) ;
} else {}
set_xy(10,25) ;
tension = round(voltage) ;
tension = tension *. 001 ;
Serial.Print(voltage) ;
Si (tension < 1) {Serial.print("mV");} else {Serial.print ("V") ;
}
set_xy(10,47) ;
voltage1 = voltage1 *. 001 ;
Serial.Print(voltage1) ;
Si (voltage1 < 1) {Serial.print("mV");} else {Serial.print ("V") ;
}
set_xy(14,49) ;
voltage2 = tension * 2 ;
réponse = 10000 * voltage1 / (voltage2 - voltage1) ; réponse = round(answer) ;
Serial.Print ((int) réponse + 1) ;
Serial.Print ("Ohms") ;
}
restore_cursor_pos() ;
Delay(3000) ;
}
void save_cursor_pos() {}
Serial.Print ("\x1B" "[s"); / / enregistrer la position du curseur
}
void restore_cursor_pos() {}
Serial.Print ("\x1B" "[u"); / / restaurer la position du curseur
}
void repeat_char (int r, char c) {}
int rx ;
pour (rx = 0; rx! = r; rx ++) {}
Serial.Print(c) ;
}
}
void set_xy (int x, int y) {}
Serial.Print("\x1B[") ;
Serial.Print(x) ;
Serial.Print(";") ;
Serial.Print(y) ;
Serial.Print("H") ;
}
void set_screen() {}
Serial.Print ("\x1B" « [2J ») ;
set_xy(1,2) ;
Serial.Print("Ohmmeter") ;
set_xy(3,2) ;
Serial.Print("\xDA") ;
repeat_char(20,0xC4) ;
Serial.Print("\xC2") ;
repeat_char(20,0xC4) ;
Serial.Print("\xBF") ;
set_xy(4,2) ;
pour (cv = 0; cv! = 2; cv ++) {}
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.println("\xB3") ;
Serial.Print("") ;
}
set_xy(6,2) ;
pour (cv = 0; cv! = 3; cv ++) {}
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB2") ;
repeat_char(20,0x20) ;
Serial.println("\xB2") ;
Serial.Print("") ;
}
set_xy(7,25) ;
Serial.Print ("R1 (10K)") ;
set_xy(9,1) ;
Serial.Print("\xC4\xC1\xC4") ;
repeat_char(19,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
set_xy(10,1) ;
Serial.Print (« \x1B [10; 1 H » "\xC4") ;
repeat_char(19,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
set_xy(11,1) ;
Serial.Print("\xC4\xC4\xC4") ;
repeat_char(19,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
set_xy(12,2) ;
Serial.Print ("\xC2") ;
repeat_char(19,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
set_xy(13,2) ;
pour (cv = 0; cv! = 3; cv ++) {}
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB2") ;
repeat_char(20,0x20) ;
Serial.println("\xB2") ;
Serial.Print("") ;
}
set_xy(16,2) ;
pour (cv = 0; cv! = 3; cv ++) {}
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.Print("\xB3") ;
repeat_char(20,0x20) ;
Serial.println("\xB3") ;
Serial.Print("") ;
}
set_xy(18,2) ;
Serial.Print("\xC0") ;
repeat_char(20,0xC4) ;
Serial.Print("\xC1") ;
repeat_char(20,0xC4) ;
Serial.Print("\xD9") ;
set_xy(7,46) ;
Serial.Print ("R2 (10K)") ;
set_xy(14,25) ;
Serial.Print ("R3 (10K)") ;
set_xy(14,46) ;
Serial.Print("RX") ;
} / / fin de copie ici