一.树莓派3B+的安装和环境配置
1.树莓派下载
https://www.raspberrypi.com/software/ 
2.网络ssh相关配置及Xshell远程连接
1.在烧录好的内存卡中创建一个新的文本文件 输入以下内容
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="你的无线网名称"
psk="你的无线网密码"
key_mgmt=WPA-PSK
priority=1
}
2.改名为wpa_supplicant.conf,再新建一个空的名为ssh的文件,再之后将内存卡插进树莓派,上电开机等待连接上手机热点 3.新建连接  4.名称随便,主机ip就是连接热点的那个树莓派的ip 如果手机看不见ip可以通过android terminal这个app查看(指令:ip neigh)  5.输入用户及密码,树莓派初始用户为pi 密码为raspberry
3.vnc服务
1.通过Xshell远程连接树莓派  2.输入指令sudo raspi-config  3.键盘方向键控制方框移动,回车选择确定 移动到第三项  4.打开vnc服务;finish; 打开另一个软件VNC Viewer;还是那个ip,名字随便  5.输入树莓派用户密码成功。
二.树莓派简单代码实现.c文件和scp 命令练习
1.使用命令nano helloworld.c命令创建文件nano hello.c 2.编辑代码如下:
#include <stdio.h>
int main()
{
printf("hello world!\n");
return 0;
}
3.使用gcc工具编译,运行 一步编译到位:gcc hello.c -o hello 4.运行:./hello  5.执行命令
sudo vim /etc/ssh/sshd_config
6.去掉 "PermitRootLogin prohibit-password "之前的注释  7.重启sudo reboot;执行systemctl restart ssh;在Ubuntu虚拟机新建一个txt文件  8.执行该文件scp test.txt like@192.168.234.175:/home/like,得到以下结果,可以发现已经成功. 
|