34. Arduino Programming
void
setup()
{
//a
comment
in
the
setup
section
which
is
run
once
Serial.begin(9600);
}
void
loop()
{
//a
comment
in
the
loop
section,
which
is
looped
forever
int
sensorValue
=
analogRead(A0);
if(sensorValue
>
0)
{
Serial.println(sensorValue);
}
delay(1);
}
36. #define
PHOTOSENSE_ANA_PIN
A0
void
setup()
{
//a
comment
in
the
setup
section
which
is
run
once
Serial.begin(9600);
}
void
loop()
{
int
microphoneValue
=
analogRead(PHOTOSENSE_ANA_PIN);
Serial.print("Sensor
Value:
");
Serial.println(microphoneValue);
delay(1000);
}