Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sensorTemp;
- void setup() {
- Serial.begin(9600);
- //set up serial port
- pinMode(10, OUTPUT);
- //pin 10 is a PWM pin which can take steps from 0-255
- digitalWrite(10, LOW);
- //turn LED off
- }
- void loop() {
- sensorTemp = analogRead(A2);
- if (sensorTemp > 147) {
- digitalWrite(10, HIGH);
- }
- else if (sensorTemp <=147) {
- digitalWrite(10, LOW);
- }
- //Debug code
- Serial.print("Value: ");
- Serial.println(sensorTemp);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement