Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- messing with tone, and conflicting pins.
- */
- int buzz = 8;
- int p3 = 3;
- int p11 =11;
- int analogPin = A0;
- int val =0;
- // the setup routine runs once when you press reset:
- void setup() {
- // initialize the digital pin as an output.
- pinMode(buzz, OUTPUT);
- pinMode(p3,OUTPUT);
- pinMode(p11, OUTPUT);
- }
- // the loop routine runs over and over again forever:
- void loop() {
- tone(buzz, 0, 500); // wait for a second
- val = analogRead(analogPin);
- analogWrite(buzz, val );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement