15回答

1收藏

[经验] 【分享】树莓派C语言编程入门

 

Raspberry Pi Raspberry Pi 43179 人阅读 | 15 人回复 | 2013-01-06

在home/pi/文件夹下建立一个hello.c文件,输入以下内容
#include <stdio.h>

void main(void)
{
    printf("Hello! This is my first C program.\r\n");
}

保存。
在终端输入
gcc hello.c -o hello 实现对hello.c的编译和连接
./hello 执行生成的可执行文件hello

看看结果,呵呵。
详细的教程看附件,第三章第13页。[attach]第3章、Linux下C编程基础.pdf[/attach]
论坛不给力,附件上传不成功,大家自己搜索《嵌入式Linux应用程序开发标准教程》。

第3章、Linux下C编程基础.pdf

962.79 KB, 下载次数: 5264

分享到:
回复

使用道具 举报

回答|共 15 个

倒序浏览

沙发

kk5290122

发表于 2013-1-6 09:56:34 | 只看该作者

沙发……………………
板凳

奔跑-350257

发表于 2013-1-6 10:04:46 | 只看该作者

WiringPi 是个什么东西??

You may be familiar with the Arduino system… Briefly; Arduino is really two things; one is a hardware platform, the other software, and part of the software is a package called Wiring. Wiring is the core of the input and output for the Arduino, so I thought it would be good to replicate that functionality (or a good usable subset) on the Raspberry Pi.

WiringPi is a wiring-like library written in C and should be usable from C++ and many other languages with suitable wrappers (See below)
地板

奔跑-350257

发表于 2013-1-7 08:53:48 | 只看该作者

哈哈,看来爱板网的用户都是Linux的老用户啊!
5#

shamowangzi

发表于 2013-1-8 01:43:24 | 只看该作者

这个不错!大家都把Pi和linux绑定了!
6#

奔跑-350257

发表于 2013-1-8 08:47:03 | 只看该作者

昨天晚上继续看了gdb调试,有点意思,原来可以不用界面的!
7#

eriklee-339839

发表于 2013-5-17 18:53:19 | 只看该作者

呵呵,其实跟普通Linux编程没啥两样
8#

outstanding1573

发表于 2014-4-14 08:26:02 | 只看该作者

顶起  不错。。。。
9#

ssj-413971

发表于 2014-5-18 00:07:24 | 只看该作者

不错有人会需要的
10#

cnc2020

发表于 2014-10-15 23:32:31 | 只看该作者

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条