给出代码。@https://github.com/Tully-L/IoT_AllSensor E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code。
Git代码上传完整步骤
根据您提供的本地路径和GitHub仓库地址,我将帮您完成代码上传:
### 1. 首先创建git项目
```
### 2. 执行Git命令上传
```bash
# 进入项目目录
cd E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code
# 初始化git仓库
git init
# 添加文件
git add .
# 首次提交
git commit -m "Initial commit: IoT sensors project"
# 添加远程仓库
git remote add origin https://github.com/Tully-L/IoT_AllSensor.git
# 推送到GitHub
git push -u origin master
```
### 3. 如果需要更新代码
```bash
# 查看修改状态
git status
# 添加修改的文件
git add .
# 提交修改
git commit -m "更新说明:添加新的传感器代码"
# 推送更新
git push origin master
```
注意事项:
1. 确保GitHub仓库 `IoT_AllSensor` 已创建
2. 如果是首次使用git,需要配置用户信息:
```bash
git config --global user.name "Tully-L"
git config --global user.email "your.email@example.com"
```
3. 使用HTTPS链接时需要输入GitHub的用户名和个人访问令牌(Personal Access Token)
4. 如果遇到推送失败,可能需要先执行:
```bash
git pull origin master
```
这样您的IoT传感器代码就会被成功上传到GitHub仓库中。
成功示例
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_Syy - 副本>cd E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>git init
Initialized empty Git repository in E:/7788/25Study/24_11PPTClass/MCUproject/IoT_code/code/.git/
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>git add .
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>git commit -m "Initial commit: IoT sensors project"
[master (root-commit) 4063ab1] Initial commit: IoT sensors project
18 files changed, 2894 insertions(+)
create mode 100644 1-USART1/usart.c
create mode 100644 1-USART1/usart.h
create mode 100644 2-BEEP/beep.c
create mode 100644 2-BEEP/beep.h
create mode 100644 3-DHT11/DHT111.c
create mode 100644 3-DHT11/DHT111.h
create mode 100644 4-LIGHT/light.c
create mode 100644 4-LIGHT/light.h
create mode 100644 6-MOTOR/motor.c
create mode 100644 6-MOTOR/motor.h
create mode 100644 7-OLED/Delay.c
create mode 100644 7-OLED/Delay.h
create mode 100644 7-OLED/OLED.c
create mode 100644 7-OLED/OLED.h
create mode 100644 7-OLED/OLED_Data.c
create mode 100644 7-OLED/OLED_Data.h
create mode 100644 8-RGB/led.c
create mode 100644 8-RGB/led.h
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>git remote add origin https://github.com/Tully-L/IoT_AllSensor.git
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>git push -u origin master
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 16 threads
Compressing objects: 100% (27/27), done.
Writing objects: 100% (27/27), 24.44 KiB | 1.53 MiB/s, done.
Total 27 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/Tully-L/IoT_AllSensor.git
* [new branch] master -> master
branch 'master' set up to track 'origin/master'.
E:\7788\25Study\24_11PPTClass\MCUproject\IoT_code\code>