arduino uno uart

Hi..
i am stuck with uart and would be grateful if i got some help from the experts.
i am reading 2 sensor values, sensor 1 and sensor 2. they both have values from 0 till 500, no decimal. and i want to send these 2 values over uart to an avr microcontroller (Atmega32).
i have been reading all over the forums, and i guess i need to use stdin, stdout, printf and scanf.
the output from arduino is like that:
324,123;432,212;442,112;
data will flow for like one min then stop, after 5 minutes it should flow again.

FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
stdout = stdin = stderr = &uart_str;

do you guys agree? or is there any other way to do that?
thanks

Hi,
Can you post a link to specs/data of the sensors please?

Thanks.. Tom... :slight_smile:

Hey Tom, thanks for replying, here the code

#define LCS_413 0x44 //default Adresse
#include <Wire.h>

void setup() 
  {
 Wire.begin();
 Serial.begin(9600); 
 delay(100);
  }

void loop() 
{
  if(Serial.available()==0)
  {
Serial.print(SENSOR1());
Serial.print(",");
Serial.print(SENSOR2());
delay(1000);

// UART code to send sensor values
/*
FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
stdout = stdin = stderr = &uart_str;
*/

  }
}

uint8_t XXX_888_readingReg(uint8_t reg) 
{
  uint8_t x ;
    Wire.beginTransmission(LCS_413);
    Wire.write((byte)reg);
    Wire.endTransmission(false);
    Wire.requestFrom((byte)LCS_413, (byte)1);
    x = Wire.read();
    return x;
}

long SENSOR1()
{
  int z=XXX_888_readingReg(0x22);
  int t=XXX_888_readingReg(0x15);
  t=t>>4;
  long n =z<<4;
  n+=t;
  return n;
}

long SENSOR2()
{
  int r=XXX_888_readingReg(0x24);
  int e=XXX_888_readingReg(0x15);
  e=e&0x0F;
  long m =r<<4;
  m+=e;
  return m;
}