First Arduino sketch:
void setup( )
void loop( )
float voltage = 0;
int sensorValue = analogRead (A0);
voltage = sensorValue * 0.0048; // code width(sensitivity) = 5 / 210 = 4.8mV
Serial.println (voltage, DEC);
This program will print the voltage(in decimal) on the serial monitor after i have connected some circuitry on a breadboard.
Second Arduino sketch:
#define SENSOR 0 // select the input pin for
// the LM335A temperature sensor
float val = 0;
float val2 = 0;
float deg = 0;
float celcius = 0;
val = analogRead(SENSOR);
val2 = val * 0.00489; // take SENSOR value and multiply it by 4.89mV
// and store value to val2
deg = val2 * 100; // multiply by 100 to get degrees in K
celcius = deg - 273.15; // subtract absolute zero to get degrees celcius
This program will print the temperature reading in degree celcius on the serial monitor.
I have tested both programs individually and it worked.
I was wondering if if i can combine both programs together.
However, there is only one serial monitor. So how do i do it?
How should i write my program then?
Can someone please help?
Thank you!! Appreciate much!!