-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemp_buzzer_test.json
More file actions
1 lines (1 loc) · 9 KB
/
Copy pathtemp_buzzer_test.json
File metadata and controls
1 lines (1 loc) · 9 KB
1
{"schemaVersion":"openhw-project-v2","board":"openhw-arduino-uno","components":[{"id":"uno1","type":"openhw-arduino-uno","label":"Arduino Uno","x":106.5,"y":277.5,"w":311,"h":228,"rotation":0,"attrs":{}},{"id":"buzzer","type":"openhw-buzzer","label":"Buzzer","x":570,"y":330,"w":36,"h":47.6,"rotation":0,"attrs":{"volume":"0.2"}},{"id":"btn1","type":"openhw-pushbutton","label":"Push Button","x":-47,"y":-25,"w":68,"h":44,"rotation":0,"attrs":{"color":"red","key":"1"}},{"id":"btn2","type":"openhw-pushbutton","label":"Push Button","x":-90,"y":308,"w":68,"h":44,"rotation":0,"attrs":{"color":"orange","key":"2"}},{"id":"btn3","type":"openhw-pushbutton","label":"Push Button","x":235,"y":-47,"w":68,"h":44,"rotation":0,"attrs":{"color":"yellow","key":"3"}},{"id":"btn4","type":"openhw-pushbutton","label":"Push Button","x":303,"y":107,"w":68,"h":44,"rotation":0,"attrs":{"color":"green","key":"4"}},{"id":"btn5","type":"openhw-pushbutton","label":"Push Button","x":390,"y":139,"w":68,"h":44,"rotation":0,"attrs":{"color":"cyan","key":"5"}},{"id":"btn6","type":"openhw-pushbutton","label":"Push Button","x":495,"y":132,"w":68,"h":44,"rotation":0,"attrs":{"color":"blue","key":"6"}},{"id":"btn7","type":"openhw-pushbutton","label":"Push Button","x":603,"y":132,"w":68,"h":44,"rotation":0,"attrs":{"color":"purple","key":"7"}},{"id":"btn8","type":"openhw-pushbutton","label":"Push Button","x":690,"y":36,"w":68,"h":44,"rotation":0,"attrs":{"color":"red","key":"8"}}],"connections":[{"id":"w_wokwi_0","from":"uno1:GND:1","to":"buzzer:2","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2"},{"id":"w_wokwi_1","from":"uno1:8","to":"buzzer:1","color":"gold","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"8","toLabel":"1"},{"id":"w_wokwi_2","from":"uno1:12","to":"btn1:1r","color":"red","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"12","toLabel":"1r"},{"id":"w_wokwi_3","from":"uno1:GND:1","to":"btn1:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_4","from":"uno1:11","to":"btn2:1r","color":"orange","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"11","toLabel":"1r"},{"id":"w_wokwi_5","from":"uno1:GND:1","to":"btn2:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_6","from":"uno1:10","to":"btn3:1r","color":"yellow","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"10","toLabel":"1r"},{"id":"w_wokwi_7","from":"uno1:GND:1","to":"btn3:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_8","from":"uno1:9","to":"btn4:1r","color":"green","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"9","toLabel":"1r"},{"id":"w_wokwi_9","from":"uno1:GND:1","to":"btn4:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_10","from":"uno1:7","to":"btn5:1r","color":"cyan","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"7","toLabel":"1r"},{"id":"w_wokwi_11","from":"uno1:GND:1","to":"btn5:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_12","from":"uno1:6","to":"btn6:1r","color":"blue","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"6","toLabel":"1r"},{"id":"w_wokwi_13","from":"uno1:GND:1","to":"btn6:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_14","from":"uno1:5","to":"btn7:1r","color":"purple","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"5","toLabel":"1r"},{"id":"w_wokwi_15","from":"uno1:GND:1","to":"btn7:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"},{"id":"w_wokwi_16","from":"uno1:4","to":"btn8:1r","color":"red","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"4","toLabel":"1r"},{"id":"w_wokwi_17","from":"uno1:GND:1","to":"btn8:2r","color":"black","waypoints":[],"isBelow":false,"isSocket":false,"isHidden":false,"isHelp":false,"fromLabel":"GND:1","toLabel":"2r"}],"blocklyXml":"","blocklyGeneratedCode":"","useBlocklyCode":false,"projectFiles":[{"id":"project/uno1/mini-piano.ino","path":"project/uno1/mini-piano.ino","name":"mini-piano.ino","kind":"code","boardId":"uno1","boardKind":"arduino_uno","content":"void setup() { pinMode(8, OUTPUT); tone(8, 440); } void loop() { }","dirty":false},{"id":"project/uno1/pitches.h","path":"project/uno1/pitches.h","name":"pitches.h","kind":"code","boardId":"uno1","boardKind":"arduino_uno","content":"/**************************************************\n This file defines constants with the frequency\n of different musical notes.\n *************************************************/\n\n#define NOTE_B0 31\n#define NOTE_C1 33\n#define NOTE_CS1 35\n#define NOTE_D1 37\n#define NOTE_DS1 39\n#define NOTE_E1 41\n#define NOTE_F1 44\n#define NOTE_FS1 46\n#define NOTE_G1 49\n#define NOTE_GS1 52\n#define NOTE_A1 55\n#define NOTE_AS1 58\n#define NOTE_B1 62\n#define NOTE_C2 65\n#define NOTE_CS2 69\n#define NOTE_D2 73\n#define NOTE_DS2 78\n#define NOTE_E2 82\n#define NOTE_F2 87\n#define NOTE_FS2 93\n#define NOTE_G2 98\n#define NOTE_GS2 104\n#define NOTE_A2 110\n#define NOTE_AS2 117\n#define NOTE_B2 123\n#define NOTE_C3 131\n#define NOTE_CS3 139\n#define NOTE_D3 147\n#define NOTE_DS3 156\n#define NOTE_E3 165\n#define NOTE_F3 175\n#define NOTE_FS3 185\n#define NOTE_G3 196\n#define NOTE_GS3 208\n#define NOTE_A3 220\n#define NOTE_AS3 233\n#define NOTE_B3 247\n#define NOTE_C4 262\n#define NOTE_CS4 277\n#define NOTE_D4 294\n#define NOTE_DS4 311\n#define NOTE_E4 330\n#define NOTE_F4 349\n#define NOTE_FS4 370\n#define NOTE_G4 392\n#define NOTE_GS4 415\n#define NOTE_A4 440\n#define NOTE_AS4 466\n#define NOTE_B4 494\n#define NOTE_C5 523\n#define NOTE_CS5 554\n#define NOTE_D5 587\n#define NOTE_DS5 622\n#define NOTE_E5 659\n#define NOTE_F5 698\n#define NOTE_FS5 740\n#define NOTE_G5 784\n#define NOTE_GS5 831\n#define NOTE_A5 880\n#define NOTE_AS5 932\n#define NOTE_B5 988\n#define NOTE_C6 1047\n#define NOTE_CS6 1109\n#define NOTE_D6 1175\n#define NOTE_DS6 1245\n#define NOTE_E6 1319\n#define NOTE_F6 1397\n#define NOTE_FS6 1480\n#define NOTE_G6 1568\n#define NOTE_GS6 1661\n#define NOTE_A6 1760\n#define NOTE_AS6 1865\n#define NOTE_B6 1976\n#define NOTE_C7 2093\n#define NOTE_CS7 2217\n#define NOTE_D7 2349\n#define NOTE_DS7 2489\n#define NOTE_E7 2637\n#define NOTE_F7 2794\n#define NOTE_FS7 2960\n#define NOTE_G7 3136\n#define NOTE_GS7 3322\n#define NOTE_A7 3520\n#define NOTE_AS7 3729\n#define NOTE_B7 3951\n#define NOTE_C8 4186\n#define NOTE_CS8 4435\n#define NOTE_D8 4699\n#define NOTE_DS8 4978\n","dirty":false},{"id":"project/uno1/library.txt","path":"project/uno1/library.txt","name":"library.txt","kind":"code","boardId":"uno1","boardKind":"arduino_uno","content":"107-Arduino-Servo-RP2040\nAdafruit MCP23017 Arduino Library\nAdafruit TSC2007\nAdafruit NeoPixel\nLiquidCrystal I2C\nServo\n107-Arduino-24LCxx\nAdafruit LiquidCrystal\nAdafruit BusIO\nAdafruit STMPE610\nAdafruit GFX Library\nAdafruit TouchScreen\nAdafruit SH110X\nAdafruit ILI9341\nSparkFun MAX3010x Pulse and Proximity Sensor Library\nAdafruit SSD1306","dirty":false}],"openCodeTabs":["project/uno1/mini-piano.ino","project/uno1/pitches.h","project/uno1/library.txt"],"activeCodeFileId":"project/uno1/mini-piano.ino","code":"/**\n Mini piano for Arduino.\n\n You can control the colorful buttons with your keyboard:\n After starting the simulation, click anywhere in the diagram to focus it.\n Then press any key between 1 and 8 to play the piano (1 is the lowest note,\n 8 is the highest).\n\n Copyright (C) 2021, Uri Shaked. Released under the MIT License.\n*/\n\n#include \"pitches.h\"\n\n#define SPEAKER_PIN 8\n\nconst uint8_t buttonPins[] = { 12, 11, 10, 9, 7, 6, 5, 4 };\nconst int buttonTones[] = {\n NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4,\n NOTE_G4, NOTE_A4, NOTE_B4, NOTE_C5\n};\nconst int numTones = sizeof(buttonPins) / sizeof(buttonPins[0]);\n\nvoid setup() {\n for (uint8_t i = 0; i < numTones; i++) {\n pinMode(buttonPins[i], INPUT_PULLUP);\n }\n pinMode(SPEAKER_PIN, OUTPUT);\n}\n\nvoid loop() {\n int pitch = 0;\n for (uint8_t i = 0; i < numTones; i++) {\n if (digitalRead(buttonPins[i]) == LOW) {\n pitch = buttonTones[i];\n }\n }\n if (pitch) {\n tone(SPEAKER_PIN, pitch);\n } else {\n noTone(SPEAKER_PIN);\n }\n}\n","name":"Wokwi Project by Uri Shaked (6)","exportedAt":"2026-05-17T19:27:18.897Z"}