Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
systemprogramming-4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eunchae Lee
systemprogramming-4
Commits
d7fc2af7
Commit
d7fc2af7
authored
1 year ago
by
Eunchae Lee
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
2e40d811
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+38
-29
38 additions, 29 deletions
README.md
with
38 additions
and
29 deletions
README.md
+
38
−
29
View file @
d7fc2af7
...
...
@@ -67,33 +67,36 @@ Use GCC to compile the source code on each Raspberry Pi:
gcc
-o
server server.c
-lwiringPi
-lpthread
-lm
```
2.
client1.c
2.
client1
(DHT1
.c
)
```
bash
gcc
-o
client1
client
1.c
-lwiringPi
-lpthread
gcc
-o
client1
DHT
1.c
-lwiringPi
-lpthread
-lm
```
3.
client2.c
3.
client2
(light
.c
)
```
bash
gcc
-o
client2
c
li
ent2
.c
-lwiringPi
-lpthread
-lm
gcc
-o
client2 li
ght
.c
-lwiringPi
-lpthread
```
4.
client3.c
4.
client3
(pir
.c
)
```
bash
gcc
-o
client3
client3
.c
-lpthread
gcc
-o
client3
pir
.c
-lpthread
-lwiringPi
```
## Usage
1.
Connect the Sensors and Actuators
-
Rpi 1
-
DHT11 Sensor:
Connect the VCC pin of the DHT11 sensor to the 5V pin on the Raspberry Pi.
Connect the GND pin of the DHT11 sensor to the GND pin on the Raspberry Pi.
Connect the DATA pin of the DHT11 sensor to the GPIO pin(2) on the Raspberry Pi.
- RPi2
- Photoresistor:
Connect one leg of the photoresistor to a 3.3V pin on the Raspberry Pi.
Connect the other leg of the photoresistor to a GPIO pin(18) through a pull-down resistor.
- RPi3
- PIR Sensor:
Connect the VCC pin to the 5V pin on the Raspberry Pi.
Connect the GND pin to the GND pin on the Raspberry Pi.'
...
...
@@ -101,14 +104,20 @@ gcc -o client3 client3.c -lpthread
- LED:
Connect one leg to the GPIO pin(18) and the other to the GND pin.
- Servo Motor:
Connect the power pins to the 5V and GND pins, and the control pin to a GPIO pin(18).
- RPi4
- Piezo Buzzer:
Connect the VCC pin to the 5V pin on the Raspberry Pi.
Connect the GND pin to the GND pin on the Raspberry Pi.'
Connect the OUTPUT pin to the GPIO pin(20) on the Raspberry Pi.
- Servo Motor:
Connect the power pins to the 5V and GND pins, and the control pin to a GPIO pin(18).
- LED:
Connect one leg to the GPIO pin(18) and the other to the GND pin.
2.
Run the Program
...
...
@@ -120,9 +129,9 @@ gcc -o client3 client3.c -lpthread
And then, execute each client program.
```
bash
./client1
.c
./client2
.c
./client3
.c
./client1
./client2
./client3
```
Each Raspberry Pi will perform its designated function, and the data will be sent to the remote server for monitoring.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment