This is my first project, so there's a lot of holes in it. Comment if you need more info, and I'll do my best to follow up.
Okay, so you've probably seen the Sonic Screwdriver from Doctor Who. It's pretty epic, so I decided to make the guts of it with an Arduino Uno.
Basically, it's an LED and a buzzer that makes sound when you press a button. Really, that's all a Sonic Screwdriver is.
All you need to do is follow the Fritzing circuit that I made:
And then, upload this code:
int BuzzTone = 1000;
void setup(){
}
void loop() {
if (digitalRead(9)==HIGH){
BuzzTone = random(300, 1000);
}
analogWrite(11, 255);
tone(10, BuzzTone);
}
What this does is constantly analog write the highest brightness to the LED, and sound to the buzzer. However, whenever you press the button, the sound changes, because it's randomized from 300 to 1000.
If you need to borrow this code for a project, go right ahead. JUST MAKE SURE TO GIVE ME CREDIT. Write //Original code by LifeFire7 in there.


_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)









_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments