Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pressure = A0;
- int pot = A1;
- int LED1 = 9;
- int LED2 = 10;
- void setup()
- {
- //pinMode(LED1, OUTPUT);
- //pinMode(LED2, OUTPUT);
- Serial.begin(9600);
- }
- void loop()
- {
- int potVal = analogRead(pot);
- int pressVal = analogRead(pressure);
- int pot1 = map(potVal, 0, 1023, 0, 255);
- int pressure1 = map(pressVal, 0, 1023, 0, 255);
- analogWrite(LED2, pot1);
- analogWrite(LED1, pressure1);
- Serial.print("Potentiometer value: ");
- Serial.print(potVal);
- Serial.print(", pressure value: ");
- Serial.println(pressVal);
- }
Add Comment
Please, Sign In to add comment