Advertisement
pleasedontcode

impossible_project rev_01

Nov 12th, 2023
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: impossible_project
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-11-12 12:26:14
  15.     - Source Code generated by: yuvraj
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <toneAC.h> // Library for playing tones with PWM
  21.  
  22. /****** SYSTEM REQUIREMENT 1 *****/
  23. /* sing a song at boot in Arduino UNO */
  24.  
  25. /****** FUNCTION PROTOTYPES *****/
  26. void setup(void);
  27. void loop(void);
  28.  
  29. /***** DEFINITION OF PWM OUTPUT PINS *****/
  30. const uint8_t speak_PIN_D3 = 3; // Define the PWM output pin for the speaker
  31.  
  32. void setup(void)
  33. {
  34.   // put your setup code here, to run once:
  35.   pinMode(speak_PIN_D3, OUTPUT); // Set the speaker pin as an output
  36.  
  37.   // Play a song at boot
  38.   toneAC(speak_PIN_D3, 440, 1000); // Play a 440Hz tone for 1 second
  39.   delay(1000); // Wait for 1 second
  40.   toneAC(speak_PIN_D3, 494, 1000); // Play a 494Hz tone for 1 second
  41.   delay(1000); // Wait for 1 second
  42.   toneAC(speak_PIN_D3, 523, 1000); // Play a 523Hz tone for 1 second
  43.   delay(1000); // Wait for 1 second
  44.   noToneAC(); // Stop playing the tone
  45. }
  46.  
  47. void loop(void)
  48. {
  49.   // put your main code here, to run repeatedly:
  50.  
  51. }
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement