Zacznę jeszcze raz, bardziej zrozumiale dla nas dwóch. Chciałbym połączyć te dwa kody w jeden:
Otwieram serial monitor a obydwa czujnik wariują, zapewne robię coś źle tylko jeszcze nie wiem co. Licżę na pomoc.
Następnym razem dam negatywa za brak code
Kod:
void setup() {
Serial.begin(9600);// open serial port, set the baud rate to 9600 bps
} void loop() {
int sensorValue;
sensorValue = analogRead(0); //connect Steam sensors to Analog 0
Serial.println(sensorValue); //print the value to serial
delay(200);
}
#define LM35 A5
void setup(){
Serial.begin(9600);
}
void loop(){
//Przeliczenie odczytu ADC na temperaturę zgodnie z opisem z kursu
float temperatura = ((analogRead(LM35) * 5.0) / 1023.0) * 100;
//Wyslanie przez UART aktualnej temperatury
Serial.print("Aktualna temperatura: ");
Serial.print(temperatura);
Serial.println("*C");
delay(200);
}
wychodzi cos takiego
#define LM35 A5
void setup() {
Serial.begin(9600);// open serial port, set the baud rate to 9600 bps
} void loop() {
int sensorValue;
sensorValue = analogRead(4); //connect Steam sensors to Analog 0
Serial.println(sensorValue); //print the value to serial
delay(200);
float temperatura = ((analogRead(LM35) * 5.0) / 1023.0) * 100;
Serial.print("Aktualna temperatura: ");
Serial.print(temperatura);
Serial.println("*C");
}
Następnym razem dam negatywa za brak code