Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- void setup() {
- for(int i=1000; i<=10000; i+=1000){
- tone(8, i, 200);
- delay(200);
- noTone(8);
- delay(200);
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
- 2.
- void setup() {
- pinMode(9, OUTPUT);
- for(int i=1000; i<=10000; i+=1000){
- tone(8, i, 200);
- digitalWrite(9, LOW);
- delay(200);
- noTone(8);
- digitalWrite(9, HIGH);
- delay(200);
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
- 3.
- void setup() {
- pinMode(9, OUTPUT);
- pinMode(13, OUTPUT);
- int sw=1;
- for(int i=1000; i<=10000; i+=1000){
- tone(8, i, 200);
- if(sw==1){
- digitalWrite(9, LOW);
- digitalWrite(13, HIGH);
- sw=0;
- }
- else{
- digitalWrite(9, HIGH);
- digitalWrite(13, LOW);
- sw=1;
- }
- delay(200);
- noTone(8);
- delay(200);
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement