void rtty_send_pressure(long p) { int temp; char buf[5]; float t; t=p/100.0; /* to hPa */ /* negative? */ if (p<0) rtty_txbyte('-'); /* integer part */ temp = (int)t; itoa(temp, buf, 10); rtty_txstring(buf); rtty_txbyte('.'); /* decimal part */ temp = (t - temp) * 100; itoa(temp, buf, 10); rtty_txstring(buf); rtty_txstring(" hPa"); }
void rtty_txstring ( char * string) { //Simple function to sent a char at a time to rtty_txbyte function. char c; c = *string++; while (c != '\n'){ rtty_txbyte (c); c = *string++; } rtty_txbyte (c); }
void rtty_send_temperature(float t) { int temp; char buf[4]; /* negative? */ if (t<0) rtty_txbyte('-'); /* integer part */ temp = (int)t; itoa(temp, buf, 10); rtty_txstring(buf); rtty_txbyte('.'); /* decimal part */ temp = (t - temp) * 100; itoa(temp, buf, 10); rtty_txstring(buf); rtty_txstring(" C"); }
void rtty_txstring (char * string) { /* Simple function to sent a char at a time to ** rtty_txbyte function. ** NB Each char is one byte (8 Bits) */ char c; c = *string++; while ( c != '\0') { rtty_txbyte (c); c = *string++; } }