Right here we go peeps. Here's my full sketch. This is my first proper go at my own skethch so please be gentle with me and any help will be greatly appreciated.
I am using a TMP 35 as the temp sensor and a piezo buzzer. The plan it to turn on and off LED's and make the amber one blink at a certain level. I am also going to make the buzzer go on and off at a specific level and then stay on with no other LED's lit at the last level.
//pin for which tmp 35 sensor inputs into the arduino uno
int TMP_35_IN_A3 = 3;
//now to declare integers of any other peripherals
//red pin connection
int RED_ALARM = 9;
yellow pin connection
int YELLOW_ALARM = 8;
//green pin connection
int GREEN_ALARM = 9;
//buzzer alarm connection
Int BUZZ_PWM_ALARM = 4;
void setup()
{
Serial.begin(9600); //this is how the chip communicates with the PC
//set ALARMS pins as output
pinMode(RED_ALARM, OUTPUT);
pinMode(YELLOW_ALARM, OUTPUT);
pinMode(GREEN_ALARM, OUTPUT);
pinMode(BUZZ_PWM_ALARM);
//setting the reference voltage to the default setting
analogReference(DEFAULT);
}
void loop()
{
long aRead = 0; //assumes voltage range from input
float voltage; //declares a floating number of the voltage
// uses a for statement to count up to 10 readings
// which will limit fluctuations when averaged out
for(int i=0; i < 10; i++)
aRead += analogRead(TMP_35_IN_A3); //reads the value from tmp sensor
aRead = aRead / 10; //now takes the average of 10 readings
//this performs the analog to digital conversion
voltage = (aRead * 5.0) / 1024.0;
//converts to millivolts
voltage = voltage * 1000;
//temp less than 30 degrees Celsius (30mV)
if( voltage <= 300 )
{
digitalWrite(GREEN_ALARM, HIGH); //turn on green alarm
digitalWrite(YELLOW_ALARM, LOW); //turn off yellow alarm
digitalWrite(RED_LED, LOW); //turn off red alarm
digitalWrite(BUZZ_PWM_ALARM, LOW); //turn off buzzer
}
else if( voltage <= 310 ) //voltage between 30 degrees and 31 degrees
//Celsius turn red and yellow on
{
digitalWrite(GREEN_ALARM, HIGH); //turn on green alarm
digitalWrite(YELLOW_ALARM, HIGH); //turn on yellow alarm
digitalWrite(RED_ALARM, LOW); //turn off red alarm
digitalWrite(BUZZ_PWM_ALARM, LOW); //turn off buzzer
}
else if( voltage <= 315) //voltage less that 31.5 degrees Celsius
{
digitalWrite(GREEN_ALARM, LOW); //turns off green alarm
digitalWrite(YELLOW_ALARM, HIGH); //turns on yellow alarm
digitalWrite(RED_ALARM, LOW); //turns off yellow alarm
digitalWrite(BUZZ_PWM_ALARM, LOW); //turns off buzzer
}
else if( voltage <= 320) //voltage less that 32 degrees Celsius
{
digitalWrite(GREEN_ALARM, LOW); //turns off green alarm
digitalWrite(BUZZ_PWM_ALARM, LOW); //turns off buzzer
digitalWrite(RED_ALARM, HIGH); //turns on red alarm
digitalWrite(YELLOW_ALARM, HIGH); //turns on yellow alarm
delay(200); //delays for 200mS
digitalWrite(YELLOW_ALARM, LOW); //turns off yellow alarm
delay(200); //delays for 200mS
}
else if( voltage <= 330) //voltage less that 33 degrees Celsius
{
digitalWrite(GREEN_ALARM, LOW); //turns off green alarm
digitalWrite(YELLOW_ALARM, LOW); //turns off yellow alarm
digitalWrite(RED_ALARM, HIGH); //turns on red alarm
analogWrite(BUZZ_PWM_ALARM, 128); //turns on buzzer
delay(500); //delays for 200mS
digitalWrite(BUZZ_PWM_ALARM, LOW); //turns off buzzer
delay(200); //delays for 200mS
}
else // anything above 33 degrees Celsius
{
digitalWrite(GREEN_ALARM, LOW); //turns off green alarm
digitalWrite(YELLOW_ALARM, LOW); //turns off yellow alarm
digitalWrite(RED_ALARM, LOW); //turns off red alarm
analogWrite(BUZZ_PWM_ALARM, 254); //turns on buzzer
//print debug info to serial console
Serial.print("Analog: ");
Serial.print(aRead);
Serial.print(" Voltage:");
Serial.println(voltage);
//short 1 sec delay between measurements
delay(1000);
}
What do people think? And remember I just learning this stuff so be gentle 
edit: I know theres some syntax errors and stuff like missing as \i have just resolved them when compiling but in general do peeps think this code will work? I have uploaded it into my arduino uno but I am waiting for my 9v dc power supply to arrive so can't yet try ity 