11th
This commit is contained in:
parent
f2a25bf54b
commit
360ee7e80b
@ -31,7 +31,7 @@ Digital sensors detect clear changes (like pressing a button), while digital out
|
||||
|
||||

|
||||
|
||||
This sensor reads the input from the physical world.
|
||||
This sensor detects when it is touched. It sends an ON signal when touched and OFF when released.
|
||||
|
||||
---
|
||||
|
||||
@ -43,19 +43,19 @@ This sensor reads the input from the physical world.
|
||||
|
||||

|
||||
|
||||
This sensor reads the input from the physical world.
|
||||
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 reads the input from the physical world.
|
||||
This sensor detects if something passes between its light beam. It is commonly used to count or detect movement.
|
||||
|
||||
---
|
||||
|
||||
@ -67,7 +67,7 @@ This sensor reads the input from the physical world.
|
||||
|
||||

|
||||
|
||||
This sensor reads the input from the physical world.
|
||||
This sensor detects tilt or angle changes. It sends an ON signal when tilted beyond a certain point.
|
||||
|
||||
---
|
||||
|
||||
@ -79,9 +79,13 @@ This sensor reads the input from the physical world.
|
||||
|
||||

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

|
||||

|
||||
|
||||
This block reads the **humidity** (moisture in the air).
|
||||
|
||||
---
|
||||
|
||||
@ -93,10 +97,14 @@ This sensor reads the input from the physical world.
|
||||
|
||||

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

|
||||
|
||||
This block adjusts the LED brightness by entering a value between **0 and 1023**.
|
||||
|
||||
---
|
||||
|
||||
### Module 07: Buzzer
|
||||
@ -107,19 +115,24 @@ This sensor reads the input from the physical world.
|
||||
|
||||

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

|
||||
|
||||
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,13 +1,10 @@
|
||||
module Spark_I2C 'cat;Output'
|
||||
author FABLAB
|
||||
version 1 1
|
||||
depends '_Gesture (PAJ7620)'
|
||||
choices direction clockwise 'counter-clockwise'
|
||||
description ''
|
||||
variables Gesture
|
||||
|
||||
spec 'r' 'Gesture Read' 'Gesture Read'
|
||||
space
|
||||
spec ' ' 'Motor Driver A' 'Motor Driver A Direction _ Speed _' 'menu.direction num' 'clockwise' 10
|
||||
spec ' ' 'Motor Driver B' 'Motor Driver B Direction _ Speed _' 'menu.direction num' 'clockwise' 10
|
||||
spec 'r' '_Direction' '_Motor Direction _' 'menu.direction' '10'
|
||||
@ -20,10 +17,6 @@ to Direction Direction {
|
||||
}
|
||||
}
|
||||
|
||||
to 'Gesture Read' {
|
||||
return ('paj7620 read')
|
||||
}
|
||||
|
||||
to 'Motor Driver A' Direction Speed {
|
||||
if ((Direction Direction) == (booleanConstant true)) {
|
||||
i2cSet 0 1 Speed
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
module Spark_PWM 'cat;Control'
|
||||
author 'FABLAB BH'
|
||||
version 1 1
|
||||
depends _Servo
|
||||
choices PWM_pins '1' '9'
|
||||
choices PWM_pins2 '3' '4' '6' '7' '8'
|
||||
choices direction clockwise 'counter-clockwise'
|
||||
@ -16,9 +15,7 @@ description ''
|
||||
space
|
||||
spec ' ' 'Fan Motor' 'Fan Motor Pin _ Direction _ Speed _ (0-100)' 'menu.PWM_pins menu.direction num' 1 'clockwise' 50
|
||||
spec ' ' 'Fan Motor2' 'Fan Motor Pin _ Direction _ Speed _ (0-1023)' 'menu.PWM_pins menu.direction num' 1 'clockwise' 50
|
||||
space
|
||||
spec ' ' 'Servo' 'Servo Motor Pin _ Speed _ (-100 to 100)' 'menu.servo_pins num' 33 50
|
||||
spec ' ' 'Servo Motor Pin' 'Servo Motor Pin _ Degrees _ (-90 to 90)' 'menu.servo_pins num' 33 90
|
||||
|
||||
|
||||
to Direction Direction {
|
||||
if (Direction == ('[data:toString]' 'counter-clockwise')) {
|
||||
@ -91,12 +88,3 @@ to 'Fan Motor4' Pin Speed {
|
||||
to 'PWM Pin' Pin {
|
||||
return (at Pin ('[data:makeList]' 13 0 26 27 0 23 16 5 18))
|
||||
}
|
||||
|
||||
to Servo Pin Speed {
|
||||
setServoSpeed Pin Speed
|
||||
}
|
||||
|
||||
to 'Servo Motor Pin' Pin Degrees {
|
||||
setServoAngle Pin Degrees
|
||||
}
|
||||
|
||||
|
||||
32
I2C/README.md
Normal file
32
I2C/README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# 🟦 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**.
|
||||
|
||||
---
|
||||
BIN
Images/33.png
Normal file
BIN
Images/33.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
Images/34.png
Normal file
BIN
Images/34.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
Images/35.png
Normal file
BIN
Images/35.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
BIN
Images/36.png
Normal file
BIN
Images/36.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@ -66,7 +66,7 @@ Some modules had more than one function (like color + brightness), making it tri
|
||||
|------------------------|--------------------|----------------------------------|--------------------------|----------------------------------|
|
||||
| LED | Film Pressure | OLED Display (Copied) | Fan Motor | Ultrasonic (Dependencies) |
|
||||
| Buzzer | Photoresistor | Motor Driver | Servo (Dependencies) | RGB LED |
|
||||
| Horn | Potentiometer | Gesture Sensor (Dependencies) | — | Traffic Light |
|
||||
| Horn | Potentiometer | — | — | Traffic Light |
|
||||
| Touch Sensor | Steam Sensor | — | — | — |
|
||||
| Button Input | — | — | — | — |
|
||||
| Photo Interrupter | — | — | — | — |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user