1 / 21

树莓派 (Raspberry Pi) 上的 Java 实践

树莓派 (Raspberry Pi) 上的 Java 实践. 闻华强. 树莓派介绍.  树莓派 (Raspberry Pi) 是一个信用卡大小的微型电脑,可以安装 ARM 版 Linux 或 Android ,尽管树莓派创造了 2012 年微型电脑的一个传奇,但是树莓派的创造者埃本 · 厄普顿和他的同事们成立树莓派基金会的初衷是鼓舞下一代成为程序员,事实上树莓派的确是学习编程的最佳平台,足够便宜,随便 Hack ,而且所有软件系统都来自于开源社区。. 树莓派的配置 = $35. 24 小时 0.084 度电 31 天 2.6 度电. 树莓派的外设与接口.

boone
Download Presentation

树莓派 (Raspberry Pi) 上的 Java 实践

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 树莓派 (Raspberry Pi) 上的Java实践 闻华强

  2. 树莓派介绍 •  树莓派(Raspberry Pi)是一个信用卡大小的微型电脑,可以安装ARM版Linux或Android,尽管树莓派创造了2012年微型电脑的一个传奇,但是树莓派的创造者埃本·厄普顿和他的同事们成立树莓派基金会的初衷是鼓舞下一代成为程序员,事实上树莓派的确是学习编程的最佳平台,足够便宜,随便Hack,而且所有软件系统都来自于开源社区。

  3. 树莓派的配置 = $35 24小时0.084度电 31天2.6度电

  4. 树莓派的外设与接口

  5. 树莓派应用场景 • 服务器集群(blog.raspichina.com) • XMBC多媒体中心 • 智能家居控制中心 • 计算机编程教育 • 你能想到的更多

  6. 树莓派与Java • Java在树莓派已经得到了很好的支持,开源社区让这一切都变得那么简单。

  7. GPIO介绍 • General Purpose Input Output (通用输入/输出)简称为GPIO,或总线扩展器,利用工业标准I2C、SMBus或SPI接口简化了I/O口的扩展。当微控制器或芯片组没有足够的I/O端口,或当系统需要采用远端串行通信或控制时,GPIO产品能够提供额外的控制和监视功能。

  8. 树莓派GPIO引脚图

  9. 树莓派GPIO引脚图-2

  10. 开发工具和库 • Eclipse、Netbeans IDEor VIM • Open JDKor Oracle JDK • Pi4J library(JNI to native WiringPI) • WiringPi:GPIO access library written in C for the BCM2835 used in the Raspberry Pi • Webiopi(基于网页的GPIO控制系统)

  11. Pi4J library(JNI to native WiringPI) • Export & unexport GPIO pins • Configure GPIO pin direction • Configure GPIO pin edge detection • Control/write GPIO pin states • Pulse GPIO pin state • Read GPIO pin states • Listen for GPIO pin state changes (interrupt-based; not polling) • Automatically set GPIO states on program termination (GPIO shutdown)

  12. Pi4J library(JNI to native WiringPI)-2 • Triggers for automation based on pin state changes • Send & receive data via RS232 serial communication • I2C Communication • SPI Communication • Extensible GPIO Provider interface to add GPIO capacity via expansion boards • Access system information and network information from the Raspberry Pi • Wrapper classes for direct access to WiringPi Library from Java

  13. Pi4J依赖框架

  14. 简单的例子开始 • 通过GPIO控制LED

  15. 准备材料 • 树莓派 1台 • SD卡 1张 • USB充电器 1个 • 杜邦线 若干 • 220Ω电阻 若干 • 面包板 一个 • LED指示灯 若干

  16. 现场演示

  17. 家用防盗系统DIY • 原理: 通过人体传感器感应是否有人进入室内,将数据实时同步的互联网或手机。 我是一朵看不见的云

  18. 准备材料 • 树莓派 1台 • SD卡 1张 • USB充电器 1个 • 迷你无线网卡 • 家用路由器(接互联网) • 人体热释电红外传感器 • 杜邦线 若干 • 220Ω电阻 若干 • 面包板 一个 • LED指示灯 若干

  19. 现场演示

  20. FAQ • ?

  21. 谢谢

More Related