嵌入式Linux(树莓派)

putty
树莓派3B+

一、树莓派执行.c文件

  1. 使用命令nano helloworld.c命令创建文件nano hello.c
  2. 编辑代码如下
    在这里插入图片描述
#include <assert.h>
#include <stdio.h>
 
int main()
{
    
    
   int x;
   char str[40];
     
   printf("请输入一个大于10整数值: ");
   scanf("%d", &x);
   assert(x > 10);
   printf("输入的整数是: %d\n", x);
    
   printf("请输入字符串: ");
   scanf("%s", str);
   assert(str != NULL);
   printf("输入的字符串是: %s\n", str);
    
   return(0);
}




  1. 使用gcc工具编译,运行
    一步编译到位:gcc hello.c -o hello

在这里插入图片描述

  1. 运行:./hello
    在这里插入图片描述

二、用scp 命令练习进行文件复制传输

  1. Ubuntu上文件内容
    在这里插入图片描述

  2. Ubuntu上使用命令scp

scp 本地Linux系统文件路径 远程用户名@IP地址:远程系统文件绝对路径名

在这里插入图片描述

  1. 树莓派接收成功

在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Mouer__/article/details/125304976