now with serialmonitor read script

This commit is contained in:
Stefan Kögl 2012-10-02 17:46:12 +02:00
parent cf064e6a4d
commit 1600c9ff23
2 changed files with 12 additions and 4 deletions

View File

@ -42,7 +42,7 @@ void setup() {
void get_temp() { void get_temp() {
// simulating an +1K/s rampup oven // simulating an +1K/s rampup oven
last_temperatur = ++temperatur; last_temperatur = temperatur++;
} }
boolean check_rampup_rate() { boolean check_rampup_rate() {
@ -62,8 +62,6 @@ void loop() {
Serial.print(" "); Serial.print(" ");
Serial.println(last_temperatur); Serial.println(last_temperatur);
// wait a second so as not to send massive amounts of data
delay(1000); delay(1000);
switch (state) { switch (state) {
@ -75,8 +73,10 @@ void loop() {
state++; state++;
} }
case PREHEAT_STATE: case PREHEAT_STATE:
if (temperatur > Ts_max) if (temperatur > Ts_max) {
Serial.println("Changed state to PREHEAT_STATE");
state++; state++;
}
break; break;
case TAL_STATE: case TAL_STATE:
break; break;
@ -88,6 +88,8 @@ void loop() {
break; break;
} }
return;
error: error:
state = END_STATE; state = END_STATE;
Serial.println(error_condition); Serial.println(error_condition);

6
serialmon.py Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/python
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
while 1:
print ser.readline()