int bluePin = 3;
int switchPin = 6;
int greenPin = 5;
int pot = A1;
void setup() {
// put your setup code here, to run once:
pinMode(switchPin, INPUT_PULLUP);
pinMode(bluePin, OUTPUT);
Serial.begin(9600);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
int temp = digitalRead(switchPin);
Serial.print("output : ");
Serial.println(temp);
int temp2 = analogRead(pot);
int frequency = map(temp2,0,1023,0,255);
analogWrite(greenPin, frequency);
// if (temp == LOW) { // Switch pressed (for pull-up configuration)
// digitalWrite(bluePin, HIGH);
// } else {
// digitalWrite(bluePin, LOW);
// }
delay(250);
}