10.02.2015 Views

wireless monitoring system of gas detector - Faculty of Electrical ...

wireless monitoring system of gas detector - Faculty of Electrical ...

wireless monitoring system of gas detector - Faculty of Electrical ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

37<br />

place as the float sensor declare in line 6 below. Analog input pin that the potentiometer<br />

<strong>of</strong> <strong>gas</strong> sensor is attached to pin A0. The declaration programming for this step shows as<br />

Figure 3.14.<br />

constintanalogInPin = A0;<br />

constintledred = 13;<br />

constintledgreen = 12;<br />

constintledyellow = 11;<br />

intsensorValue = 0;<br />

float sensor;<br />

figure 3.14: Arduino input and output port initialization<br />

After that, loop is very important which represent all the data will continuously<br />

repeat by time. In this project, there are 2 loop include. First loop is to initialize serial<br />

communication at the bound rate 9600. This is also sets the digital pin as the output as<br />

shown in Figure 3.15.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!