Compare commits

...
5 Commits
Author SHA1 Message Date
fatimaxsen 29447ae04d Modifying 2025-05-29 12:28:09 +03:00
fatimaxsen fcdf799a1e Adding 2025-05-29 12:16:28 +03:00
fatimaxsen 2b158dad7b Modifing 2025-05-29 12:15:34 +03:00
fatimaxsen 02b166a732 Adding a new file 2025-05-29 12:11:58 +03:00
fatimaxsen 0a395e29dd Adding a new version 2025-05-29 12:11:30 +03:00
6 changed files with 64 additions and 40 deletions

No files matched your search

-16
View File
@@ -1,16 +0,0 @@
module Buzzer
author unknown
version 1 0
description ''
spec ' ' 'Buzzer' 'Buzzer Pin _ State _' 'auto bool' 5 true
spec ' ' 'Buzzer2 Pin' 'Buzzer Pin _ Note _' 'auto auto' 5 1000
to Buzzer Pin State {
digitalWriteOp Pin State
}
to 'Buzzer2 Pin' Pin Note {
analogWriteOp Pin Note
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

+8 -22
View File
@@ -1,13 +1,13 @@
# Buzzer Library for MicroBlocks # Buzzer Library for MicroBlocks
Welcome to the **Buzzer Library** for MicroBlocks! Welcome to the **Buzzer Library** for MicroBlocks!
This library makes it easy for anyone—even if you don’t know how to code or use a computer much—to control a fan motor using simple blocks in MicroBlocks. This library makes it easy for anyone—even if you don’t know how to code or use a computer much—to control a buzzer using simple blocks in MicroBlocks.
--- ---
## Features ## Features
- **Easy drag-and-drop blocks** for controlling your fan motor - **Easy drag-and-drop blocks** for controlling your buzzer
- **No coding required** - **No coding required**
- **Turn on & off the buzzer** - **Turn on & off the buzzer**
- **Control the notes** - **Control the notes**
@@ -20,14 +20,14 @@ This library makes it easy for anyone—even if you don’t know how to code or
**What you need:** **What you need:**
- Spark microcontroller and connecting wires - Spark microcontroller and connecting wires
- MicroBlocks IDE installed ([Download here](https://microblocks.fun/download/)) - MicroBlocks IDE installed ([Download here](https://microblocks.fun/download/))
- A fan motor and basic connecting wires - A buzzer and basic connecting wires
--- ---
## Installation ## Installation
1. **Download the Fan Motor Library:** 1. **Download the buzzer Library:**
Download the library file from [here](Buzzer.ubl). Download the library file from [here](Spark_Digital.ubl).
2. **Open MicroBlocks IDE** on your computer. 2. **Open MicroBlocks IDE** on your computer.
@@ -51,12 +51,12 @@ This library makes it easy for anyone—even if you don’t know how to code or
- Turn Buzzer On and Off - Turn Buzzer On and Off
- Change Note" - Change Note"
5. **Click the green flag** or “Run” to start controlling your fan! 5. **Click the green flag** or “Run” to start controlling your buzzer!
--- ---
## Example Project ## Example Project
![](Images/4.png) ![](Images/6.png)
After setting the pin value, there are two ways to use a buzzer: After setting the pin value, there are two ways to use a buzzer:
@@ -65,19 +65,5 @@ After setting the pin value, there are two ways to use a buzzer:
--- ---
## Troubleshooting *Have fun building with your buzzer!*
- **Fan not spinning?**
- Double-check your wiring.
- Make sure your microcontroller is powered on.
- **Blocks not showing up?**
- Make sure you imported the library correctly.
- **Still stuck?**
- See the “Contact” section below!
---
*Have fun building with your Buzzer!*
+46
View File
@@ -0,0 +1,46 @@
module Spark_Digital 'cat;Data'
author 'Fatima Idrees'
version 1 0
description ''
spec ' ' 'Buzzer' 'Buzzer Pin _ Tone _' 'num num' 5 1000
spec ' ' 'Buzzer2' 'Buzzer Pin _ State _' 'auto bool' 5 false
spec ' ' 'LED' 'LED Pin _ State _' 'num bool' 18 false
spec ' ' 'LED2 Pin' 'LED Pin _ Brightness _' 'num auto' 18 1000
spec 'r' 'Button Pin' 'Button Pin _' 'auto' 27
spec 'r' 'Inverted Button Pin' 'Inverted Button Pin _' 'auto' 27
to 'Button Pin' Input {
local 'Read1' (digitalReadOp Input 'up')
if (Read1 == (booleanConstant true)) {
return (not Read1)
} else {
return (booleanConstant true)
}
}
to Buzzer Pin Tone {
analogWriteOp Pin Tone
}
to Buzzer2 Pin State {
digitalWriteOp Pin State
}
to 'Inverted Button Pin' Input {
local 'Read2' (digitalReadOp Input 'up')
if (Read2 == (booleanConstant false)) {
return Read2
} else {
return (booleanConstant true)
}
}
to LED Pin State {
digitalWriteOp Pin State
}
to 'LED2 Pin' Pin Brightness {
analogWriteOp Pin Brightness
}
+10 -2
View File
@@ -3,15 +3,23 @@
## Version 01 ## Version 01
![](../Images/1.png) ![](../Images/1.png)
![](../Images/3.png) ![](../Images/3.png)
It essentially turns the buzzet on or off and allows the user to adjust its notes. It essentially turns the buzzet on or off and allows the user to adjust its notes.
---
# Version 02
![](../Images/5.png)
Modified to suit the new library.
--- ---
## Usage Example ## Usage Example
![](../Images/4.png) ![](../Images/6.png)
A way to test the function! A way to test the function!