Components and supplies
1
Arduino LilyPad USB
1
Battery, 3.7 V
1
LilyPad Button Board
1
LilyPad Buzzer
Project description
Code
Reverse Headphones ("Say So")
arduino
1//Say So by Doja Cat 2 3int buzzer = A3; 4int buttonPin = A4; 5 6int NOTE_B3 = 247; 7int NOTE_C4 = 262; 8int NOTE_CS4 = 277; 9int NOTE_D4 = 294; 10int NOTE_DS4 = 311; 11int NOTE_E4 = 330; 12int NOTE_F4 = 349; 13int NOTE_FS4 = 370; 14int NOTE_G4 = 392; 15int NOTE_GS4 = 415; 16int NOTE_A4 = 440; 17int NOTE_AS4 = 466; 18int NOTE_B4 = 494; 19int NOTE_C5 = 523; 20int NOTE_CS5 = 554; 21int NOTE_D5 = 587; 22int NOTE_DS5 = 622; 23int NOTE_E5 = 659; 24int NOTE_F5 = 698; 25int NOTE_FS5 = 740; 26int NOTE_G5 = 784; 27int NOTE_GS5 = 831; 28int NOTE_A5 = 880; 29 30 31 32//note length here 33 34int whole = 2100; 35 36int sixteenth = whole/16; 37int eighth = whole/8; 38int quarter = whole/4; 39int half = whole/2; 40int beat = 15; 41 42 43 44void setup() 45{ 46 // Set the buzzer pin to be an output: 47 48 pinMode(buttonPin, INPUT_PULLUP); 49 pinMode(buzzer, OUTPUT); 50} 51 52void loop() 53{ 54 int buttonState; 55 int switchState; 56 57 // Read and save the states of the button and switch: 58 59 buttonState = digitalRead(buttonPin); 60 61 if (buttonState == LOW) // Check to see if buttonState is LOW (pressed) 62 { 63 64 65 //Day to night to morning 66 67 tone(buzzer,NOTE_FS4); 68 delay(eighth); 69 70 tone(buzzer,NOTE_E4); 71 delay(eighth); 72 73 tone(buzzer,NOTE_FS4); 74 delay(eighth); 75 76 tone(buzzer,NOTE_E4); 77 delay(eighth); 78 79 tone(buzzer,NOTE_FS4); 80 delay(eighth); 81 82 tone(buzzer,NOTE_FS4); 83 delay(sixteenth); 84 85 tone(buzzer,NOTE_E4); 86 delay(eighth); 87 88 noTone(buzzer); 89 delay(sixteenth); 90 91 92 93 94 95//Keep with me in the moment 96 97 tone(buzzer,NOTE_E4); 98 delay(eighth); 99 100 noTone(buzzer); 101 delay(beat); 102 103 tone(buzzer,NOTE_E4); 104 delay(eighth); 105 106 noTone(buzzer); 107 delay(beat); 108 109 tone(buzzer,NOTE_E4); 110 delay(eighth); 111 112 tone(buzzer,NOTE_FS4); 113 delay(eighth); 114 115 tone(buzzer,NOTE_CS4); 116 delay(eighth); 117 118 noTone(buzzer); 119 delay(beat); 120 121 tone(buzzer,NOTE_CS4); 122 delay(eighth); 123 124 tone(buzzer,NOTE_CS4); 125 delay(sixteenth); 126 127 tone(buzzer,NOTE_B3); 128 delay(eighth); 129 130 131 132 133 134 //I'd let you had I known it 135 136 noTone(buzzer); 137 delay(sixteenth); 138 139 tone(buzzer,NOTE_FS4); 140 delay(eighth); 141 142 tone(buzzer,NOTE_E4); 143 delay(eighth); 144 145 tone(buzzer,NOTE_CS4); 146 delay(eighth); 147 148 tone(buzzer,NOTE_E4); 149 delay(eighth); 150 151 tone(buzzer,NOTE_CS4); 152 delay(eighth); 153 154 tone(buzzer,NOTE_E4); 155 delay(eighth); 156 157 tone(buzzer,NOTE_E4); 158 delay(sixteenth); 159 160 tone(buzzer,NOTE_CS4); 161 delay(eighth); 162 163 164 165 166 167 168//Why don't you say so? 169 170 noTone(buzzer); 171 delay(sixteenth); 172 173 tone(buzzer,NOTE_E4); 174 delay(eighth); 175 176 noTone(buzzer); 177 delay(beat); 178 179 tone(buzzer,NOTE_E4); 180 delay(eighth); 181 182 noTone(buzzer); 183 delay(beat); 184 185 tone(buzzer,NOTE_E4); 186 delay(eighth); 187 188 tone(buzzer,NOTE_FS4); 189 delay(quarter); 190 191 tone(buzzer,NOTE_CS4); 192 delay(quarter); 193 194 noTone(buzzer); 195 delay(quarter); 196 197 198 199 200 201//Didn't even notice 202 203 tone(buzzer,NOTE_FS4); 204 delay(eighth); 205 206 tone(buzzer,NOTE_E4); 207 delay(eighth); 208 209 tone(buzzer,NOTE_FS4); 210 delay(eighth); 211 212 tone(buzzer,NOTE_E4); 213 delay(eighth); 214 215 tone(buzzer,NOTE_FS4); 216 delay(eighth); 217 218 tone(buzzer,NOTE_FS4); 219 delay(sixteenth); 220 221 tone(buzzer,NOTE_E4); 222 delay(eighth); 223 224 noTone(buzzer); 225 delay(sixteenth); 226 227 228 229//No punches left to roll with 230 231 tone(buzzer,NOTE_E4); 232 delay(eighth); 233 234 noTone(buzzer); 235 delay(beat); 236 237 tone(buzzer,NOTE_E4); 238 delay(eighth); 239 240 noTone(buzzer); 241 delay(beat); 242 243 tone(buzzer,NOTE_E4); 244 delay(eighth); 245 246 tone(buzzer,NOTE_FS4); 247 delay(eighth); 248 249 tone(buzzer,NOTE_CS4); 250 delay(eighth); 251 252 noTone(buzzer); 253 delay(beat); 254 255 tone(buzzer,NOTE_CS4); 256 delay(eighth); 257 258 tone(buzzer,NOTE_CS4); 259 delay(sixteenth); 260 261 tone(buzzer,NOTE_B3); 262 delay(eighth); 263 264 265 266 267 268 //You've got to keep me focused 269 270 noTone(buzzer); 271 delay(sixteenth); 272 273 tone(buzzer,NOTE_FS4); 274 delay(eighth); 275 276 tone(buzzer,NOTE_E4); 277 delay(eighth); 278 279 tone(buzzer,NOTE_CS4); 280 delay(eighth); 281 282 tone(buzzer,NOTE_E4); 283 delay(eighth); 284 285 tone(buzzer,NOTE_CS4); 286 delay(eighth); 287 288 tone(buzzer,NOTE_E4); 289 delay(eighth); 290 291 tone(buzzer,NOTE_E4); 292 delay(sixteenth); 293 294 tone(buzzer,NOTE_CS4); 295 delay(eighth); 296 297 298 299 //Why don't you say so? 300 301 noTone(buzzer); 302 delay(sixteenth); 303 304 tone(buzzer,NOTE_E4); 305 delay(eighth); 306 307 noTone(buzzer); 308 delay(beat); 309 310 tone(buzzer,NOTE_E4); 311 delay(eighth); 312 313 noTone(buzzer); 314 delay(beat); 315 316 tone(buzzer,NOTE_E4); 317 delay(eighth); 318 319 tone(buzzer,NOTE_FS4); 320 delay(quarter); 321 322 tone(buzzer,NOTE_CS4); 323 delay(quarter); 324 325 noTone(buzzer); 326 delay(quarter); 327 328} 329 330 else 331 { 332 digitalWrite(buzzer,LOW); // If buttonState is HIGH (unpressed), turn off the buzzer 333 } 334} 335
Reverse Headphones ("Say So")
arduino
1//Say So by Doja Cat 2 3int buzzer = A3; 4int buttonPin = A4; 5 6int NOTE_B3 = 247; 7int NOTE_C4 = 262; 8int NOTE_CS4 = 277; 9int NOTE_D4 = 294; 10int NOTE_DS4 = 311; 11int NOTE_E4 = 330; 12int NOTE_F4 = 349; 13int NOTE_FS4 = 370; 14int NOTE_G4 = 392; 15int NOTE_GS4 = 415; 16int NOTE_A4 = 440; 17int NOTE_AS4 = 466; 18int NOTE_B4 = 494; 19int NOTE_C5 = 523; 20int NOTE_CS5 = 554; 21int NOTE_D5 = 587; 22int NOTE_DS5 = 622; 23int NOTE_E5 = 659; 24int NOTE_F5 = 698; 25int NOTE_FS5 = 740; 26int NOTE_G5 = 784; 27int NOTE_GS5 = 831; 28int NOTE_A5 = 880; 29 30 31 32//note length here 33 34int whole = 2100; 35 36int sixteenth = whole/16; 37int eighth = whole/8; 38int quarter = whole/4; 39int half = whole/2; 40int beat = 15; 41 42 43 44void setup() 45{ 46 // Set the buzzer pin to be an output: 47 48 pinMode(buttonPin, INPUT_PULLUP); 49 pinMode(buzzer, OUTPUT); 50} 51 52void loop() 53{ 54 int buttonState; 55 int switchState; 56 57 // Read and save the states of the button and switch: 58 59 buttonState = digitalRead(buttonPin); 60 61 if (buttonState == LOW) // Check to see if buttonState is LOW (pressed) 62 { 63 64 65 //Day to night to morning 66 67 tone(buzzer,NOTE_FS4); 68 delay(eighth); 69 70 tone(buzzer,NOTE_E4); 71 delay(eighth); 72 73 tone(buzzer,NOTE_FS4); 74 delay(eighth); 75 76 tone(buzzer,NOTE_E4); 77 delay(eighth); 78 79 tone(buzzer,NOTE_FS4); 80 delay(eighth); 81 82 tone(buzzer,NOTE_FS4); 83 delay(sixteenth); 84 85 tone(buzzer,NOTE_E4); 86 delay(eighth); 87 88 noTone(buzzer); 89 delay(sixteenth); 90 91 92 93 94 95//Keep with me in the moment 96 97 tone(buzzer,NOTE_E4); 98 delay(eighth); 99 100 noTone(buzzer); 101 delay(beat); 102 103 tone(buzzer,NOTE_E4); 104 delay(eighth); 105 106 noTone(buzzer); 107 delay(beat); 108 109 tone(buzzer,NOTE_E4); 110 delay(eighth); 111 112 tone(buzzer,NOTE_FS4); 113 delay(eighth); 114 115 tone(buzzer,NOTE_CS4); 116 delay(eighth); 117 118 noTone(buzzer); 119 delay(beat); 120 121 tone(buzzer,NOTE_CS4); 122 delay(eighth); 123 124 tone(buzzer,NOTE_CS4); 125 delay(sixteenth); 126 127 tone(buzzer,NOTE_B3); 128 delay(eighth); 129 130 131 132 133 134 //I'd let you had I known it 135 136 noTone(buzzer); 137 delay(sixteenth); 138 139 tone(buzzer,NOTE_FS4); 140 delay(eighth); 141 142 tone(buzzer,NOTE_E4); 143 delay(eighth); 144 145 tone(buzzer,NOTE_CS4); 146 delay(eighth); 147 148 tone(buzzer,NOTE_E4); 149 delay(eighth); 150 151 tone(buzzer,NOTE_CS4); 152 delay(eighth); 153 154 tone(buzzer,NOTE_E4); 155 delay(eighth); 156 157 tone(buzzer,NOTE_E4); 158 delay(sixteenth); 159 160 tone(buzzer,NOTE_CS4); 161 delay(eighth); 162 163 164 165 166 167 168//Why don't you say so? 169 170 noTone(buzzer); 171 delay(sixteenth); 172 173 tone(buzzer,NOTE_E4); 174 delay(eighth); 175 176 noTone(buzzer); 177 delay(beat); 178 179 tone(buzzer,NOTE_E4); 180 delay(eighth); 181 182 noTone(buzzer); 183 delay(beat); 184 185 tone(buzzer,NOTE_E4); 186 delay(eighth); 187 188 tone(buzzer,NOTE_FS4); 189 delay(quarter); 190 191 tone(buzzer,NOTE_CS4); 192 delay(quarter); 193 194 noTone(buzzer); 195 delay(quarter); 196 197 198 199 200 201//Didn't even notice 202 203 tone(buzzer,NOTE_FS4); 204 delay(eighth); 205 206 tone(buzzer,NOTE_E4); 207 delay(eighth); 208 209 tone(buzzer,NOTE_FS4); 210 delay(eighth); 211 212 tone(buzzer,NOTE_E4); 213 delay(eighth); 214 215 tone(buzzer,NOTE_FS4); 216 delay(eighth); 217 218 tone(buzzer,NOTE_FS4); 219 delay(sixteenth); 220 221 tone(buzzer,NOTE_E4); 222 delay(eighth); 223 224 noTone(buzzer); 225 delay(sixteenth); 226 227 228 229//No punches left to roll with 230 231 tone(buzzer,NOTE_E4); 232 delay(eighth); 233 234 noTone(buzzer); 235 delay(beat); 236 237 tone(buzzer,NOTE_E4); 238 delay(eighth); 239 240 noTone(buzzer); 241 delay(beat); 242 243 tone(buzzer,NOTE_E4); 244 delay(eighth); 245 246 tone(buzzer,NOTE_FS4); 247 delay(eighth); 248 249 tone(buzzer,NOTE_CS4); 250 delay(eighth); 251 252 noTone(buzzer); 253 delay(beat); 254 255 tone(buzzer,NOTE_CS4); 256 delay(eighth); 257 258 tone(buzzer,NOTE_CS4); 259 delay(sixteenth); 260 261 tone(buzzer,NOTE_B3); 262 delay(eighth); 263 264 265 266 267 268 //You've got to keep me focused 269 270 noTone(buzzer); 271 delay(sixteenth); 272 273 tone(buzzer,NOTE_FS4); 274 delay(eighth); 275 276 tone(buzzer,NOTE_E4); 277 delay(eighth); 278 279 tone(buzzer,NOTE_CS4); 280 delay(eighth); 281 282 tone(buzzer,NOTE_E4); 283 delay(eighth); 284 285 tone(buzzer,NOTE_CS4); 286 delay(eighth); 287 288 tone(buzzer,NOTE_E4); 289 delay(eighth); 290 291 tone(buzzer,NOTE_E4); 292 delay(sixteenth); 293 294 tone(buzzer,NOTE_CS4); 295 delay(eighth); 296 297 298 299 //Why don't you say so? 300 301 noTone(buzzer); 302 delay(sixteenth); 303 304 tone(buzzer,NOTE_E4); 305 delay(eighth); 306 307 noTone(buzzer); 308 delay(beat); 309 310 tone(buzzer,NOTE_E4); 311 delay(eighth); 312 313 noTone(buzzer); 314 delay(beat); 315 316 tone(buzzer,NOTE_E4); 317 delay(eighth); 318 319 tone(buzzer,NOTE_FS4); 320 delay(quarter); 321 322 tone(buzzer,NOTE_CS4); 323 delay(quarter); 324 325 noTone(buzzer); 326 delay(quarter); 327 328} 329 330 else 331 { 332 digitalWrite(buzzer,LOW); // If buttonState is HIGH (unpressed), turn off the buzzer 333 } 334} 335
Downloadable files
Schematics
Schematics

Comments
Only logged in users can leave comments