Java Solaris Communities Partners My Sun Sun Store China Worldwide
» 简介
    简要了解 Sun SPOT(当前页)
» Ectoplasmic Bouncing Ball 演示程序
»   加载和运行 Air Text 演示程序
»   更改 Air Text 演示程序
»   基站实战
 
Sun SPOT 快速入门教程

简要了解 Sun SPOT

 
 
如何打开 Sun SPOT

在运行 Sun SPOT 前,我们先对它有一个大致的了解。您应该有三个 Sun SPOT。其中一个是基站,其余两个是移动 Sun SPOT.

以移动 Sun SPOT 为例,它上面有一个盖子,有时,这个盖子被称为 Sun 屋顶。需要打来此盖才可以看到一些开关和 LED。要打开这个盖子,需同时 向下向后 按。可以用指甲卡住盖子边缘的突点发力,尽量向后压,这样会很容易打开盖子,参见下图:

The graphic shows a Sun SPOT, held in the left hand, with the right hand grasping the SPOT, thumb on top, fingers curled unde4rneath.  The thumb and thumbnail are pressing down on a small bump on the lid.The graphic shows a Sun SPOT  being held in the left hand. The thumb of the user's right hand is pressing down on the lid just above the radio fin.  The lid is popping up on the end opposite from where the thumb is pressing down.

盖子的另一端将弹出来,这时即可用手夹着盖子边缘将其取出。

打开后即可看到位于传感器板上的 LED 和开关。

The graphic shows a Sun SPOT with the lid removed and the eDemo board exposed.  The radio fin is pointing up and, near the top of the opening is a row of LEDs.  Under the LEDs are two switches.  Labels in the diagram call attention to the LED and switch locations.

它们由 Java 程序控制,所以根据所运行程序的不同,会有不同的表现。位于 SPOT 顶端的片状物是无线电天线鳍,它用来放置无线通信时所需天线。

倾斜 SPOT 天线鳍会离开原位置,这时您即可看到控制按钮。

The illustration shows a Sun SPOT from the narrow end.  The end shown is the one opposite the radio fin.  It shows a small button to the left, LEDs on either side of the button, and a USB connector on the right.  The diagram labels only the button, which is calls a 'Control Button.'

控制按钮的作用是复位 SPOT、使 spot 进入睡眠状态或将其唤醒。当 SPOT 处于睡眠状态时,快速轻按(不是长按)控制按钮将唤醒 SPOT。当 SPOT 处于唤醒状态时,快速轻按 Control Button 复位 SPOT 并重新启动正运行的程序。要使 SPOT 进入睡眠状态,长按控制按钮 5 秒钟即可。演示如下:

  • 启动 SPOT: 选取其中一个移动 SPOT,短按上面的控制按钮,这将开启 SPOT。这时,右边的 LED 会闪烁绿色大约两秒钟,为 SPOT 检查是否已与主工作站连接。同时,SPOT 上的演示也会打开顶端的 LED。
  • 关闭 SPOT: 长按控制按钮大约 5 秒钟,左边的 LED 会闪烁两下红色然后黑屏,即已关闭 SPOT。
  • 复位 SPOT:开启 SPOT,预载入的演示会继续运行。要复位正运行的 SPOT,只需再次短按控制按钮即可,这时右边的 LED 会闪烁绿色大约两秒钟。

现在,您已经掌握了 SPOT 控制按钮的使用方法。

注意: 如果无法启动移动 Sun SPOT,或者当按控制按钮时右边的 LED 没有闪烁,可能是 Sun SPOT 电池电量不足,要为 Sun SPOT 电池充电,使用所提供的 USB 电缆线把 SPOT 连接到一台正运行的计算机的 USB 接口上即可,电池充满的时间大约为 3 小时。

下面是 SPOT 控制按钮两侧的 LED 的详细信息。

The illustration shows a Sun SPOT from the narrow end.  The end shown is the one opposite the radio fin.  It shows a small button to the left, LEDs on either side of the button, and a USB connector on the right.  The diagram labels the leftmost LED as the 'Power LED' and the rightmost LED as the 'Activity LED.'

这些 LED 可以通过 SPOT 上的 Java 程序控制,但是一般情况下,它们由 SPOT 上的操作环境控制,左边的 LED 显示 SPOT 的电量状态,下面是它给出的一些重要信号:

电量 LED 信号 意义
闪烁三次红色 电量不足
缓慢交替闪烁亮绿和暗绿色 USB 正在充电,CPU 活动状态
缓慢闪烁暗绿色 USB 正在充电,CPU 睡眠状态
稳定显示暗绿色 与 USB 相连,电池充满,CPU 活动状态
稳定显示暗红色 电池电量低
快速闪烁一次绿色 正在复位,重新启动程序
一次明亮的绿色脉冲显示,快速显现缓慢消失
电量上升

右边的 LED 由应用程序控制,如果状态没有改变,系统程序会显示 SPOT 的通信状态。下面是一些重要信号:

活动 LED 信号 含义
快速闪烁绿色
正搜索与主工作站 USB 链接
闪烁绿色 正从主工作站收到数据包
闪烁红色 正向主工作站发送数据包
每 12 秒闪烁两次绿色 基站正常功能

您已经对 Sun SPOT 有了基本的了解,现在可以 尝试运行演示程序


下一页:Ectoplasmic Bouncing Ball 演示程序

返回顶部