15th
This commit is contained in:
parent
2e39a7b7bb
commit
89560b85da
@ -1,61 +0,0 @@
|
|||||||
# 🟩 Analog
|
|
||||||
|
|
||||||
### What is Analog?
|
|
||||||
|
|
||||||
Analog signals are smooth and continuous. They can represent values that change gradually—like light, pressure, or temperature.
|
|
||||||
Analog sensors read these changing values from the physical world and convert them into numbers the microcontroller can understand.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Included Modules:
|
|
||||||
|
|
||||||
- [Film Pressure](#module-01-film-pressure-sensor)
|
|
||||||
- [Photoresistor](#module-02-photoresistor)
|
|
||||||
- [Potentiometer](#module-03-potentiometer)
|
|
||||||
- [Steam Sensor](#module-04-steam-sensor)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 01: Film Pressure Sensor
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||

|
|
||||||
|
|
||||||
This sensor reads **pressure**. When you press on it, it gives a higher value based on how strong the pressure is.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 02: Photoresistor
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||

|
|
||||||
|
|
||||||
This sensor reads **light**. The brighter the light, the higher the value it gives.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 03: Potentiometer
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||

|
|
||||||
|
|
||||||
This sensor reads **rotation or position**. Turning the knob changes the value, making it useful for adjusting brightness, speed, or volume.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 04: Steam Sensor
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||

|
|
||||||
|
|
||||||
This sensor reads **moisture in the air** (humidity). It's useful in weather stations or projects that detect steam or damp environments.
|
|
||||||
|
|
||||||
---
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
# 🟥 Digital
|
|
||||||
|
|
||||||
### What is Digital?
|
|
||||||
|
|
||||||
Digital signals are either **ON** or **OFF**—like a light switch.
|
|
||||||
Digital sensors detect clear changes (like pressing a button), while digital outputs perform actions (like turning on a light or sound).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Included Modules:
|
|
||||||
|
|
||||||
#### 🔌 Inputs:
|
|
||||||
- [Touch Sensor](#module-01-touch-sensor)
|
|
||||||
- [Button Input](#module-02-button-input)
|
|
||||||
- [Photo Interrupter](#module-03-photo-interrupter)
|
|
||||||
- [Tilt Switch](#module-04-tilt-switch)
|
|
||||||
- [Temp & Humidity](#module-05-temp--humidity)
|
|
||||||
|
|
||||||
#### 💡 Outputs:
|
|
||||||
- [LED](#module-06-led)
|
|
||||||
- [Buzzer](#module-07-buzzer)
|
|
||||||
- [Relay](#module-08-relay)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 01: Touch Sensor
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This sensor detects when it is touched. It sends an ON signal when touched and OFF when released.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 02: Button Input
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This sensor detects when the button is pressed. It sends an ON signal while the button is held down.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 03: Photo Interrupter
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This sensor detects if something passes between its light beam. It is commonly used to count or detect movement.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 04: Tilt Switch
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This sensor detects tilt or angle changes. It sends an ON signal when tilted beyond a certain point.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 05: Temp & Humidity
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block reads the **temperature** from the environment.
|
|
||||||
|
|
||||||
#### Block 2:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block reads the **humidity** (moisture in the air).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 06: LED
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block turns the LED ON or OFF using a **true/false** value.
|
|
||||||
|
|
||||||
#### Block 2: (PWM)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block adjusts the LED brightness by entering a value between **0 and 1023**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 07: Buzzer
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block turns the buzzer ON or OFF using a **true/false** value.
|
|
||||||
|
|
||||||
#### Block 2: (PWM)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block changes the buzzer’s sound level using a value between **0 and 1023**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 08: Relay
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block controls the relay like a switch—**ON or OFF**—allowing you to turn other devices on or off through the relay.
|
|
||||||
|
|
||||||
---
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
# 🟦 I2C
|
|
||||||
|
|
||||||
### What is I2C?
|
|
||||||
|
|
||||||
I2C (Inter-Integrated Circuit) is a communication protocol that allows multiple sensors and modules to connect using just **two wires**—one for data (SDA) and one for clock (SCL).
|
|
||||||
It’s especially useful for connecting devices like screens, motor drivers, or environmental sensors that need to **send and receive data**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Included Modules:
|
|
||||||
|
|
||||||
- [Motor Driver](#module-01-motor-driver)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 01: Motor Driver
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block A:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block is used to control **Motor A**.
|
|
||||||
|
|
||||||
#### Block B:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block is used to control **Motor B**.
|
|
||||||
|
|
||||||
---
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
# 🟧 Multi-Digital Pins
|
|
||||||
|
|
||||||
### What are Multi-Digital Pins?
|
|
||||||
|
|
||||||
Some modules use **more than one digital pin** to work correctly. These pins may be used to send or receive multiple signals at the same time—like controlling several LEDs, reading from multiple buttons, or sending commands to more complex components.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Included Modules:
|
|
||||||
|
|
||||||
#### 🔌 Inputs:
|
|
||||||
- [Ultrasonic](#module-01-7-segment-display)
|
|
||||||
|
|
||||||
#### 💡 Outputs:
|
|
||||||
- [RGB LED](#module-01-7-segment-display)
|
|
||||||
- [Traffic Light](#module-01-7-segment-display)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 01: Ultrasonic
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This sensor reads input from the physical world.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 2: RGB LED
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block allows to control red, green and blue color as on and off.
|
|
||||||
|
|
||||||
#### Block 2: (PWM)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block allows to control red, green and blue color in a range 0-255.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 03: Traffic Light
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block allows to control red, yellow and green color as on and off.
|
|
||||||
|
|
||||||
#### Block 2: (PWM)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block allows to control red, yellow and green color in a range 0-255.
|
|
||||||
|
|
||||||
---
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
# 🟨 PWM
|
|
||||||
|
|
||||||
### What is PWM?
|
|
||||||
|
|
||||||
PWM (Pulse Width Modulation) is a technique used to **control power** to devices by turning the signal on and off very quickly.
|
|
||||||
By adjusting how long the signal stays on during each cycle, we can control things like **brightness**, **speed**, or **intensity**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Included Modules:
|
|
||||||
|
|
||||||
- [Fan Motor](#module-01-fan-motor)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Module 01: Fan Motor
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Block 1:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block controls the fan speed in a range from **1 to 100**.
|
|
||||||
|
|
||||||
#### Block 2:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block controls the fan speed in a range from **1 to 1023**.
|
|
||||||
|
|
||||||
#### Block 3:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block controls the fan speed in a range from **1 to 100**, with **direction control**.
|
|
||||||
|
|
||||||
#### Block 4:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This block controls the fan speed in a range from **1 to 1023**, with **direction control**.
|
|
||||||
|
|
||||||
---
|
|
||||||
71
README.md
71
README.md
@ -2,74 +2,3 @@
|
|||||||
|
|
||||||
[Spark](https://fablab.bh/spark/) is a course by FABLAB BH that teaches students the basics of electronics and coding using the Spark Kit and MicroBlocks. What’s cool is that students in the program also teach other students!
|
[Spark](https://fablab.bh/spark/) is a course by FABLAB BH that teaches students the basics of electronics and coding using the Spark Kit and MicroBlocks. What’s cool is that students in the program also teach other students!
|
||||||
|
|
||||||
---
|
|
||||||
## Microcontroller
|
|
||||||

|
|
||||||
|
|
||||||
### 🌟 What is this board, and what is it used for?
|
|
||||||
This is a **Microcontroller**, think of it like a power strip for electronic parts! You can plug in cool things like lights, buttons, or sensors without needing to do any wiring or soldering. It helps you build projects easily—just plug and play!
|
|
||||||
|
|
||||||
### 🎨 What do the different pin colors (red, black, yellow, blue, green, white) mean?
|
|
||||||
These colors help you quickly understand what kind of signal each port uses. Think of it like a superhero color code—each one has a special job!
|
|
||||||
|
|
||||||
🟢 Green = Analog pins
|
|
||||||
These can read smooth changes, like how much light or how hot something is.
|
|
||||||
|
|
||||||
🔴 Red = Digital pins
|
|
||||||
These are for ON/OFF things, like turning a light on or off.
|
|
||||||
|
|
||||||
🔵 Blue = I2C pins
|
|
||||||
These are used when devices need to talk to each other, like a screen or a sensor sending data.
|
|
||||||
|
|
||||||
🟡 Yellow = PWM pins
|
|
||||||
These can control brightness or speed, like dimming an LED or changing motor speed.
|
|
||||||
|
|
||||||
🟠 Orange = Multiple Digital pins
|
|
||||||
These ports can control more than one digital signal, good for things like RGB LEDs!
|
|
||||||
|
|
||||||
### 🔢 Why are the ports numbered from 1 to 9? What’s the purpose of these numbers?
|
|
||||||
The numbers help you quickly know where things are plugged in.
|
|
||||||
|
|
||||||
When you're building your project or writing code, the numbers make it easier to say:
|
|
||||||
➡️ “My button is in port 2” or “The LED goes in port 6.”
|
|
||||||
|
|
||||||
We use these numbers when we explain things to you, so you can follow along easily and not get confused.
|
|
||||||
It's like giving every port a name—so we can talk to them and work together as a team! 👩🏫👨🔧
|
|
||||||
|
|
||||||
---
|
|
||||||
## Issues and Solutions
|
|
||||||
|
|
||||||
### 🛠️ Issue 1: Incorrect Pin Mapping
|
|
||||||
The pins shown in MicroBlocks didn’t match the actual pins on the microcontroller.
|
|
||||||
|
|
||||||
✅ Solution: We created a drop-down menu that shows the correct pin numbers as labeled on the microcontroller.
|
|
||||||
|
|
||||||
### 🛠️ Issue 2: Inverted Module Behavior
|
|
||||||
Some modules behaved in reverse—turning ON in code would turn them OFF in real life (and vice versa).
|
|
||||||
|
|
||||||
✅ Solution: We created custom blocks that automatically handle inverted logic for those modules.
|
|
||||||
|
|
||||||
### 🛠️ Issue 3: Modules Needing Multiple Pins
|
|
||||||
Some modules, like RGB LEDs, required controlling multiple pins at once, which made coding harder and repetitive.
|
|
||||||
|
|
||||||
✅ Solution: We created dedicated blocks for these modules that manage all required pins together, making it easier to control them with a single command.
|
|
||||||
|
|
||||||
### 🛠️ Issue 4: Complex Modules with Many Features
|
|
||||||
Some modules had more than one function (like color + brightness), making it tricky to support all features in one block.
|
|
||||||
|
|
||||||
✅ Solution: We made more than one block per module when needed, each one focusing on a specific feature (e.g. one for color, one for brightness).
|
|
||||||
|
|
||||||
---
|
|
||||||
## These Modules Got Blocks!
|
|
||||||
|
|
||||||
| Digital | Analog | I2C | PWM | Multi-pin Modules |
|
|
||||||
|------------------------|--------------------|----------------------------------|--------------------------|----------------------------------|
|
|
||||||
| LED | Film Pressure | OLED Display (Copied) | Fan Motor | Ultrasonic (Dependencies) |
|
|
||||||
| Buzzer | Photoresistor | Motor Driver | Servo (Dependencies) | RGB LED |
|
|
||||||
| Horn | Potentiometer | — | — | Traffic Light |
|
|
||||||
| Touch Sensor | Steam Sensor | — | — | — |
|
|
||||||
| Button Input | — | — | — | — |
|
|
||||||
| Photo Interrupter | — | — | — | — |
|
|
||||||
| Tilt Switch | — | — | — | — |
|
|
||||||
| Temp & Humidity (Dependencies) | — | — | — | — |
|
|
||||||
| Relay | — | — | —
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
# 🖥️ iScreen
|
|
||||||
|
|
||||||
This library is already documented in the [MicroBlocks Wiki](https://wiki.microblocks.fun/en/extension_libraries/oled).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ✏️ Examples
|
|
||||||
|
|
||||||
You can use this library to **write messages** and **draw shapes** on the screen.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
You can also draw letters, especially useful when **non-English languages** are not supported in MicroBlocks.
|
|
||||||
|
|
||||||

|
|
||||||
Loading…
x
Reference in New Issue
Block a user