RoboPeak迷你显示器现已支持Intel Galileo开发板

English Version

RoboPeak迷你显示器现已支持Intel Galileo开发板,运行基于Debian Linux系统的GNOME桌面。

相关的预编译固件可在固件下载页面获得。

下载Galileo固件后,您只需要解压到SD卡并从SD卡启动系统即可。
系统启动完成后,你可以通过有线网络使用SSH登陆到系统。Galileo开发板的默认IP地址是192.168.1.100,用户名/密码:root/rp123.

Enjoy!

Galileo

RoboPeak Mini USB Display now support Intel Galileo board

中文版

RoboPeak Mini USB Display now support Intel Galileo board, running Debian based GNOME desktop.

You can download related pre-built ROM in the firmware download page.

For the downloaded Galileo image, you just need to unzip the file to your SD card and boot the system.
After booting, you can connect to the Intel Galileo board using ssh through Ethernet.
The default ip address of the Galileo board is 192.168.1.100, username/password: root/rp123.

Enjoy!

Galileo

RPLIDAR现已支持ROS和Arduino

我们的RPLIDAR激光雷达目前支持了世界上2个著名的开源项目:ROS和Arduino。

ROS是机器人领域的开源操作系统。它的模块化设计节约了开发人员的大量时间,使他们可以更好的专注于机器人应用的开发。Arduino是一个非常易用的MCU开发平台,它使得任何人设计自己的电路成为可能。

我们为ROS设计了RPLIDAR的专门驱动node,方便开发人员将RPLIDAR整合到他们的机器人上。其驱动代码可以从github获得:https://github.com/robopeak/rplidar_ros.

rplidar_github

为Arduino,我们提供了RPLIDAR的驱动库。Arduino玩家可以像标准RPLIDAR sdk那样在Arduino上获取RPLIDAR的扫描数据了。另外,我们也提供了例程!

DSC00808rplidar_arduinoVoila_Capture 2014-05-17_12-03-07

该实例库目前已随着RPLIDAR开发套装的SDK一起发布。它的源代码也可在github找到:https://github.com/robopeak/rplidar_arduino.

RPLIDAR now supports ROS and Arduino

Now our RPLIDAR laser scanner supports two greatest opensource systems in the world: ROS and Arduino.

ROS is an open source operating system for Robotic applications. Its modular design (node) saves a lot efforts to build a new robot application. Arduino is an easy to use MCU development board, with Arduino, everyone can play with circuit now.

For ROS, we provide a driver node to help users integrate our RPLIDAR into their robots.  It is available on our github: https://github.com/robopeak/rplidar_ros.

rplidar_github

 

For Arduino, we made a driver library ready. Arduino users can use this library to fetch RPLIDAR data just as the standard RPLIDAR sdk does. Also, we provides related examples !

DSC00808

rplidar_arduinoVoila_Capture 2014-05-17_12-03-07

 

 

 

The library is included in our development kit SDK. You can find its source code at: https://github.com/robopeak/rplidar_arduino.

 

RoboPeak Mini USB显示屏粉墨登场

English Version

提示:购买方式请点此
引言:过去,在留声的世界里,没有声音,再好的戏也听不到;如今,在喧嚣的开源舞台上,没有屏幕,再好的戏也出不来。RoboPeak Mini USB显示屏(下称RPUSBDisp)作为开源硬件的一款重要利器粉墨登场与大家隆重见面。

RPUSBDIAP

简介

随着计算终端逐渐由桌面向掌上转移,我们见证了智能手机的蓬勃发展。而过去复杂的操作系统也逐渐摆脱了庞大的身躯,从桌面PC移植到到了MiniPC中:树梅派、Cubieboard、可以运行OpenWrt的路由器等,这些变得小巧,易于携带的嵌入式平台,同样大多拥有Ghz级别的CPU。

P1070216

像MiniPC这样如此小巧的系统所蕴藏着的不可小视的计算资源成为了各爱好者和众多开源硬件厂商梦寐以求的计算解决方案。然而以往在MiniPC上进行调试或者需要显示图像画面与用户交互时,依旧要借助那笨重的HDMI显示器或者电视机。

为了让设备显示同样的便携与省电,RoboPeak荣幸推出便捷式带有触摸功能的USB显示器。它专门针对MiniPC设计,仅有名片那么大,只需要一根USB数据线即可工作,且无需额外供电。

特点

广泛的设备支持

您可以使用它作为目前各种嵌入式开发板(如树梅派、Cubieboard等)的显示器来使用!得益于USB接口,这使得以往无法连接显示器输出的设备也有机会通过RPUSBDisp显示画面,比如您的路由器就可以。并且我们也支持Arduino Yun,Intel Galileo 开发版!

标准的设备接口

配合RoboPeak开发的配套驱动程序,RPUSBDisp可以被目标操作系统识别为标准的显示器和触摸屏设备,这意味着任何现有的图形界面程序无需做任何的修改即可在RPUSBDisp显示。

开源意味着更多可能

作为开源项目,我们提供了它的原理图、通讯协议、Linux内核驱动代码等。方便您基于RPUSBDisp实现更多的创意。

下面我们先通过一段视频向各位展示RPUSBDisp是如何使用的。

性能提要

  • 显示器分辨率:320×240
  • 色彩深度:16bpp
  • 屏幕尺寸:2.8吋
  • 通讯方式:USB2.0 Full-Speed
  • USB接口规格:Micro-USB
  • 触控屏:单点电阻式
  • 尺寸大小:长74mm,宽60mm

请参考文档数据手册获取更多产品参数信息。

支持的硬件平台

RPUSBDisp可以支持任何具有USB Host通讯功能的计算设备,作为他们的标准显示器和触摸屏设备。您只需增加对应的驱动程序即可。对于目前被绝大多数嵌入式设备使用的Linux平台,我们提供了开源的内核驱动。

为了方便您的使用,我们提供了常见开发平台,如流行的树梅派(raspberry-pi)、cubieboard等的预编译ROM镜像。您只需要简单的将这些镜像文件下载,写入您的开发板内即可使用RPUSBDisp了!

目前我们提供如下平台的ROM镜像下载(将不断增加中),相关下载链接请参考后文的固件下载章节。

1. 树莓派
P1070153

2. cubieboard (I代与II代)
P1070140

3. pcDuino
P1070182

4. 基于Allwinner A10/ Rockchip RK3066方案的MiniPC 电视棒 (MK802,UG802等)
P1070194

5. WR703N迷你路由器
P1070200

使用方式

请参考用户手册文档了解具体的使用方式。

RPUSBDisp作为一款全新的产品面世,其核心的驱动尚未成为MiniPC厂商固件里默认的一份子。为了让RPUSBDisp工作,您需要安装RPUSBDisp配套的驱动程序。

快速上手:使用预装驱动的ROM镜像

对于常见的MiniPC,您只需简单的下载并刷入由我们提供的预装有USB显示屏驱动程序的ROM镜像即可。

我们提供了绝大多数MiniPC平台的SD卡ROM镜像,可以使用镜像写入工具(windows: Win32DiskImager, Linux/Mac: dd)将镜像写入SD卡,即可使用。

对于具有内置Nand Flash的设备(比如Cubieboard、大多数MiniPC电视棒),我们提供了打包好的nand flash ROM镜像,使用配套的下载工具即可将支持RPUSBDisp显示的ROM永久固化在您的开发版内。

具体的操作方式请参考用户手册

进阶使用:编译内核驱动实现支持

对于我们尚未提供ROM镜像的设备,也不用担心,我们提供了RPUSBDisp的Linux内核驱动代码。您可以按照下文文档和源代码中README的步骤自行编译驱动,即可将RPUSBDisp在您的设备上运行。

资深用户:自定义驱动程序

对于不满足我们现有驱动方式的用户,也可以通过我们公布的USB通讯协议规范自定义更加强大的驱动程序。

固件下载

获取RoboPeak官方支持的固件请点击:下载地址

文档与源代码

如不额外说明,这次给出的源代码均遵循GPL v2协议规范,或者以代码中采用的许可为准。文档的版权均归RoboPeak所有。

如果在使用过程中遇到Bug或者有任何改进建议,请给我们留言或联系我们 (support@robopeak.com)。

注意:RoboPeak不对任何因不当使用开源代码而可能造成的损失承担法律责任。

购买方式

目前DFRobot作为我们的指定代理商负责销售RPUSBDisp,欢迎访问下列地址购买。

 

激光键盘软件源代码编译和修改指南

English Version: http://www.robopeak.net/blog/?p=332

I. 简介

RoboPeak 开源虚拟激光投影键盘设计的所有源代码已经发布在Github上。该源代码遵循LGPL许可。只要遵循LGPL许可的规范,您可以随意的使用或者修改本源代码。

本文旨在介绍如何在Windows以及MacOS平台上编译RoboPeak 开源虚拟激光投影键盘的信号处理软件。此外,也介绍了一些技术细节问题,帮助您理解代码并开发新的酷功能。

快速参考:

  • 如何在Windows上编译运行代码
  • 如何在MacOS上编译运行代码
  • 更多细节

II.  从源代码编译的理由

首先,从源代码编译允许您体验到我们为激光键盘开发的最新功能,这些功能并不会立刻在稳定版本中发布。您可以成为最早体验这些功能的人。

其次,如果您需要对我们的软件做出修改或者做改进。能编译源代码就是必经之路了。

此外,如果我们的信号处理软件无法在您的系统运行,那么在我们团队做出修正前,您可先尝试自己编译源代码来解决此问题。

III. 先要准备的

  • Windows

Windows XP 以及更高版本

Visual Studio 2010 (带有VC++包) 或者 Visual C++ 2010 express (更高的版本也可工作,但我们暂不作保证)

Git工具支持 (例如: msysgit)

  • MacOS

OS10.7 或更高版本 (我们使用OS10.8)

XCode 4.5 或者带有gcc支持的更高版本 (我们不使用 llvm-gcc进行编译)

GIT 工具(您可使用 macport or homebrew 来安装它)

除了上述的系统环境需求外,我们默认您具有基本的软件开发基础,例如:了解如何在Windows/MacOS上开发编译C++的程序,知道OpenCV是什么,GIT是什么。此外,您需要知道如何从github clone源代码

IV. 在Windows上编译运行源代码

STEP1: 从Github clone源代码

我们推荐您使用tortoise-git clone源代码到您本地的文件夹中,如下图例子那样;
tutorisegit_clone 或者直接基于如下命令行:

git clone https://github.com/robopeak/laserkbd.git

在Cl0ne完毕后,您应该看到如下的文件结构: cloned_source

STEP2: 在VS2010中编译

进入laser_kbd_neo 文件夹并打开VS项目文档:laser_kbd.sln:

vs2010

您只需要选择Release编译配置并开始编译即可。编译完毕后,您可以在 laser_kbd_neoRelease文件夹中找到编译好的可执行文件:laser_kbd.exe

vs_compiled

STEP3: 将必要的依赖文件复制并打包

上述编译产生的可执行文件需要其他依赖文件才能执行,并且这些依赖文件需要与可执行文件位于同一个目录。因此您需要将这些文件复制过来。我们推荐您创建一个新的目录,例如在代码根目录下建立一个output这样的目录,并将laser_kbd.exe以及下列文件夹、文件复制进来:

  • laser_kbd_neores 文件夹
  • sdkpackrefdll*.dll

最终的软件包应该看起来像这样: vs_released

大功告成!

现在您自己编译的信号处理软件已经可以工作了! win32_done

V. 在MacOS下编译源代码

STEP#1 Clone源代码

使用如下命令将Github的源代码clone至您本地的文件系统:

$ git clone https://github.com/robopeak/laserkbd.git

在clone完毕后您应该看到如下的文件结构

Shikais-MacBook-Pro:laserkbd csk$ ls
README.md laser_kbd_neo sdkpack

STEP#2 在XCode中编译运行

进入目录laser_kbd_neo/xcode, 打开项目文件LaserKeyborad.xcodeproj.

xcode_compile

您可以直接点击运行按钮就可以编译出可以执行的软件包了(Debug版本)

macos_compiled

VI. 实现细节浅析

1. 文件组织

本源代码文件按照如下的结构进行组织

<source root>
      +---- laser_kbd_neo/            <--- 所有的源代码、IDE用到的工程文档
      |          +---- ref/           <--- 第三方库的源代码
      |          +---- res/           <--- 软件所用到的图片、数据等文件
      |          +---- src/           <--- 信号处理软件自身的源代码
      |          |      +---- port/      <--- 平台相关的源代码
      |          +---- xcode/         <--- MacOS/xcode相关的源代码和项目文档
      |          |---- laser_kbd.sln  <--- Visual Studio 2010项目文档
      +---- sdkpack
                 +---- license_and_copyrights/   <--- 第三方库的许可协议和README文档
                 +---- ref/
                        +---- dll/               <--- 第三方库的预编译dll (win32)
                        +---- lib/               <--- 第三方库的预编译lib (win32)
                        +---- inc/               <--- 第三方库的头文件
                        +---- dylib/             <--- 第三方库的预编译dll (MacOS)

 

2. 如何将代码移植到其他平台下?

本信号处理软件在开发初期就考虑了高度可移植性,表现在:

1) 所有的核心处理逻辑都是平台无关的代码

2) 所有平台相关的代码都放在了目录 src/port 里

3) 在平台相关/平台无关代码之间有明确的接口作桥梁

4) 所有依赖到的第三方库也是高度跨平台的,例如: OpenCV

如果您打算将源代码移植到新的平台下,您需要为这个新平台实现一个新的移植层(port layer)。这个移植层至少需要提供如下功能:

  • 按键事件注入

当“键盘”按下后,往OS注入对应的键盘事件

  • 摄像头视频捕捉已经曝光控制

由于OpenCV本身不允许用户代码控制摄像头的曝光参数,因此移植层需要实现这个机制。

所有对平台相关代码的调用接口都定义在了src/port/common文件夹里面。如果您确定要开始移植工作,则应该从这些接口定义开始入手。

此外,您也可以参考目前Windows和MacOS上的移植层。

3. 如何修改键盘布局?kbd_layout

位于src/keyboard_emu/layout_provider.cpp 的代码控制信号处理软件内部的键盘布局信息。 (实际的虚拟键盘投射元件也需要做出修改).

通过修改 _key_mapper[] 描述数组,可以实现对软件中键盘布局的修改。

4. 如何实现在“按键”时播放声音提示?

该功能已经在Windows平台中实现.

由于播放音频的方法是与具体操作系统相关的,因此推荐将这个功能放在移植层里面实现。这里将举例说明如何在Windows上实现这个功能。

我们使用如下的Win32 api实现播放一段制定的wav音频:

BOOL sndPlaySound(
 LPCTSTR lpszSound,
 UINT fuSound
 );

在这个例子里,我们使用的音频文件叫做type.wav. 当用户“按键”后,windows就会播放这个声音:

在移植层中定义了接口OSKeyInjector::injectKeyEvents用于操作用户“按键”以后的事情. 可以从这里入手加入播放声音的功能:

如下是Windows平台中该接口的原始实现代码 (keyinjector_win32.cpp)

    virtual bool injectKeyEvents( const std::vector<KeyEventDesc> & intputlist)
    {
        if (!intputlist.size()) return false;

        INPUT * inputs = new INPUT[intputlist.size()];

        do
        {
            for (int pos=0; pos<intputlist.size(); ++pos)
            {
                inputs[pos].type = INPUT_KEYBOARD;
                inputs[pos].ki.wVk = intputlist[pos].keyval;

                if (intputlist[pos].type == KEY_EVENT_PRESSED) {
                    hasinputs = true;
                    inputs[pos].ki.dwFlags =  0;
                } else {
                    inputs[pos].ki.dwFlags =  KEYEVENTF_KEYUP;
                }

                inputs[pos].ki.time = 0;
            }

            SendInput(intputlist.size(), inputs, sizeof(INPUT));

        }while(0);

        delete [] inputs;

        return true;
    }

我们将它修改如下:

    virtual bool injectKeyEvents( const std::vector<KeyEventDesc> & intputlist)
    {
        if (!intputlist.size()) return false;

+        bool hasinputs = false;

        INPUT * inputs = new INPUT[intputlist.size()];

        do
        {
            for (int pos=0; pos<intputlist.size(); ++pos)
            {
                inputs[pos].type = INPUT_KEYBOARD;
                inputs[pos].ki.wVk = intputlist[pos].keyval;

                if (intputlist[pos].type == KEY_EVENT_PRESSED) {
+                    hasinputs = true;
                    inputs[pos].ki.dwFlags =  0;
                } else {
                    inputs[pos].ki.dwFlags =  KEYEVENTF_KEYUP;
                }

                inputs[pos].ki.time = 0;
            }

            SendInput(intputlist.size(), inputs, sizeof(INPUT));

        }while(0);

        delete [] inputs;

+        if (hasinputs && g_config_bundle.playsound) {
+            // play sound feedback
+            std::string soundfile = FILEPATH_RESOURCE_SOUND_FOLDER;
+            soundfile += "type.wav";
+            ::sndPlaySoundA( soundfile.c_str(), SND_ASYNC);
+        }

        return true;
    }

这样按键声音反馈功能就实现好了。您可以自行编译github的源代码体验一下:)

Tips for Compiling the Laser Keyboard Software Source Code

I. Introduction

Currently, the full source code of RoboPeak open source laser projection keyboard design has been published on Github. The released source code applies the LGPL license. You can freely use the code and modify it as long as you follow the terms described in LGPL. This article describes how to compile the source code of the  signal processing software for RoboPeak Laser Projection Keyboard on Windows and MacOS systems. Besides, some in-depths implementation details are provided to help you understand the source code and make cool modifications.

Quick Ref:

  • Compile the source on Windows
  • Compile the source on MacOS
  • More details

II.  Reasons to compile the source code

Firstly, compiling the source code allows you to experience the latest features which hasn’t been included in the stable release version yet. You can be the very first personal to trail these cool features.

Secondly, if you want to make some modifications/improvements to the current design, compiling the source code is the first step.

Thirdly, if you find our released signal processing software cannot work on your system, compiling the source code by yourself may be a quick solution before RoboPeak team release bug fix to your issues.

III. Prerequisite

  • Windows

Windows XP or higher version

Visual Studio 2010 (with VC++ package installed) or Visual C++ 2010 express (higher version may work as well, but they haven’t been tested yet)

Git Tool support (e.g. msysgit)

  • MacOS

OS10.7 or higher (we use OS10.8)

XCode 4.5 or higher with GCC support (we don’t use llvm-gcc)

GIT tool (you can install it using macport or homebrew)

Besides the above requirements, we also assume you have some basic ideas related to software developement: e.g. how to compile a C++ program on Windows/MacOS, what OpenCV is , what GIT is , etc Also, you need to clone the latest source on github.

IV. Compile the source code on Windows

STEP1: clone the source code from github

We recommend you to use tortoise-git to clone the source code to your local folder. The following is an example: tutorisegit_clone or using the following command:

git clone https://github.com/robopeak/laserkbd.git

You should get the following file structure after the clone operation has been finished: cloned_source

STEP2: Compile the source using VS2010

Enter the laser_kbd_neo folder and open the VS solution file laser_kbd.sln:

vs2010

To build the source code, simply using the Release configuration and start build. You will find the compiled binary file laser_kbd.exe under the folder: laser_kbd_neoRelease:

vs_compiled

STEP3: Copy the essential files to build the working package

The generated executable requires its dependencies to be present in the same folder. You need to copy these dependencies to make the compiled software work. It is recommended to create a clean folder like output under the root of the source code: i.e.   laserkbd_source_rootoutput Copy the above laser_kbd.exe into this folder, and the following files as well:

  • laser_kbd_neores folder
  • sdkpackrefdll*.dll files

The final package should look like the following: vs_released

Done!

The signal processing software build by your own is ready to go now! win32_done

V. Compile the source code on MacOS

STEP#1 Clone the source code

Clone the laser keyboard source code to your local folder using the following command:

$ git clone https://github.com/robopeak/laserkbd.git

You should find the following files/folders in the cloned source folder:

Shikais-MacBook-Pro:laserkbd csk$ ls
README.md laser_kbd_neo sdkpack

STEP#2 Compile the source using XCode

Enter the folder laser_kbd_neo/xcode, open the project file: LaserKeyborad.xcodeproj.

xcode_compile

You can execute the final workable software package simply click the Run button (for debug version)

macos_compiled

VI. Implementation tips

1. file organization

The source code tree is organized based on the following structure:

<source root>
      +---- laser_kbd_neo/            <--- All the source code/IDE project files/3rd party libs src
      |          +---- ref/           <--- source code of the 3rd party libs
      |          +---- res/           <--- image/data required by the software
      |          +---- src/           <--- source code of the signal processing software
      |          |      +---- port/      <--- target platform dependent code
      |          +---- xcode/         <--- MacOS/xcode related code and the project file
      |          |---- laser_kbd.sln  <--- Visual Studio 2010 solution file
      +---- sdkpack
                 +---- license_and_copyrights/   <--- license/readme files of the 3rd party libs
                 +---- ref/
                        +---- dll/               <--- prebuilt dll binaries of the 3rd party libs (win32)
                        +---- lib/               <--- prebuilt static lib binaries of the 3rd party libs (win32)
                        +---- inc/               <--- header source of the 3rd party libs
                        +---- dylib/             <--- prebuilt dll binaries of the 3rd party libs (MacOS)

 

2. How to port the code to other platforms?

The signal processing software is inherently designed with highly portability:

1) all the core logic is implemented as platform independent

2) all the target specific code. is located under the src/port folder

3) there is a clean interface between the platform independent code and the target specific code.

4) all the 3rd libs required by the software are highly portable as well, e.g. OpenCV

If you want to port the code to a new platform, you should implement a new port layer for that platform. The port layer should provide at least the  following functions:

  • Key event injection

Inject key events to the target OS when virtual keys is pressed

  • Camera video capture and exposure control

As openCV doesn’t provide interface to allow user code to control a camera’s exposure value. The port layer should implement it.

The interfaces to  the target specific code are defined in the header files under the src/port/common folder. If you really want to do the port work, you should start from that place.

Also, the existing Windows and MacOS port layers are good reference for you.

3. how to change the keyboard layout?kbd_layout

The code inside the file src/keyboard_emu/layout_provider.cpp controls the keyboard layout used by the software (the actual keyboard layout projector should be changed as well).

You can modify the _key_mapper[] array to change the layout.

4. how to add sound feedback when a “key” has been pressed?

This feature has been implemented on Windows target.

As the way to playing a sound is target specific, it is recommended to implement the code inside the port layer. Here is the example to show you how to do this on Windows platform.

We use the following Win32 API to play a sound from a given wav file:

BOOL sndPlaySound(
 LPCTSTR lpszSound,
 UINT fuSound
 );

In the example, we choose a wav file called type.wav. When user press “keys”, Windows will play the sound.

The interface OSKeyInjector::injectKeyEvents defined in the port  layer will be invoked when user pressed “keys”. It should be a good place for us to added the sound feedback.

Here is a snapshot of the injectKeyEvents implementation on Windows platform (keyinjector_win32.cpp)

    virtual bool injectKeyEvents( const std::vector<KeyEventDesc> & intputlist)
    {
        if (!intputlist.size()) return false;

        INPUT * inputs = new INPUT[intputlist.size()];

        do
        {
            for (int pos=0; pos<intputlist.size(); ++pos)
            {
                inputs[pos].type = INPUT_KEYBOARD;
                inputs[pos].ki.wVk = intputlist[pos].keyval;

                if (intputlist[pos].type == KEY_EVENT_PRESSED) {
                    hasinputs = true;
                    inputs[pos].ki.dwFlags =  0;
                } else {
                    inputs[pos].ki.dwFlags =  KEYEVENTF_KEYUP;
                }

                inputs[pos].ki.time = 0;
            }

            SendInput(intputlist.size(), inputs, sizeof(INPUT));

        }while(0);

        delete [] inputs;

        return true;
    }

We changed the above code to the following:

    virtual bool injectKeyEvents( const std::vector<KeyEventDesc> & intputlist)
    {
        if (!intputlist.size()) return false;

+        bool hasinputs = false;

        INPUT * inputs = new INPUT[intputlist.size()];

        do
        {
            for (int pos=0; pos<intputlist.size(); ++pos)
            {
                inputs[pos].type = INPUT_KEYBOARD;
                inputs[pos].ki.wVk = intputlist[pos].keyval;

                if (intputlist[pos].type == KEY_EVENT_PRESSED) {
+                    hasinputs = true;
                    inputs[pos].ki.dwFlags =  0;
                } else {
                    inputs[pos].ki.dwFlags =  KEYEVENTF_KEYUP;
                }

                inputs[pos].ki.time = 0;
            }

            SendInput(intputlist.size(), inputs, sizeof(INPUT));

        }while(0);

        delete [] inputs;

+        if (hasinputs && g_config_bundle.playsound) {
+            // play sound feedback
+            std::string soundfile = FILEPATH_RESOURCE_SOUND_FOLDER;
+            soundfile += "type.wav";
+            ::sndPlaySoundA( soundfile.c_str(), SND_ASYNC);
+        }

        return true;
    }

Now the sound feedback feature has been implemented. You may checkout the latest source to have a try:)

Arduino-Lite Development Reference Manual

(中文版请点击这里)

Please refer to the following documents for the introduction and usage of Arduino-Lite:

Arduino-Lite keeps most interfaces provided by Arduino. For the reference manual of these interfaces, please refer to the Doc on Arduino Official website: http://arduino.cc/en/Reference/HomePage

Besides, you can use all the functions provided by avr-gcc, e.g. _delay_ms() (make sure to include related head files).

Index:

Functions/Macros added by Arduino-Lite

Basic IO

PWM output & control

Analog Signal Capturing(ADC)

Sleep & Delay

Interrupt handling & Control

Serial Port Communication

Debugging support

Text Formatting

Continue reading Arduino-Lite Development Reference Manual

Arduino-Lite, Lightweight AVR library developed by RoboPeak(2)

中文版请看这里

This is the second article in the series, which introduces the installation and usage of the Arduino-Lite.

Arduino-Lite is a lightweight high-performance firmware library for AVR mcus, which is developed based on the original Arduino project. We make it easy to use, just like the Arduino. Compared to the original library, Arduino-Lite generates smaller binaries and perform faster.

Some brief introduction to the Arudino-Lite: Arduino-Lite, Lightweight AVR library used by RoboPeak(1)

1. What are included in Arduino-Lite?

Arduino-Lite hosted on Google Code consists of:

  • Source code of Arduino-Lite firmware library
  • WINAVR (avr-gcc) compiler set
  • Arduino-Lite compiling system
  • Tools
  • Samples and templates

Arduino-Lite users only need to download the package to develop, compile, burn/upload and even debug AVR programs, along with system default text editors(notepad, vim); no third-party library are required. Arduino-Lite, for sure, do not prevent you from using any software or libraries.

2. Download and configure Arduino-Lite

2.1 Get Arduino-Lite

The open source version of Arduino-Lite can be retrived from Google Code:http://code.google.com/p/arduino-lite/。There are two ways to get Arduino-Lite:

  • Compressed Package

In the Download section of our Google Code project page, we released compressed packages of Arduino-Lite, what are named like arduino-lite-r1.0.zip. After downloading, no installation steps are needed, just decompress to some folder.

  • SVN

Check out any revision anonymously from the svn repository hosted on Google Code.

Continue reading Arduino-Lite, Lightweight AVR library developed by RoboPeak(2)

Arduino-Lite, Lightweight AVR library developed by RoboPeak(1)

中文版请看这里

Arduino-Lite is a lightweight high-performance firmware library for AVR MCUs, which is developed based on the original Arduino project. We make it easy to use, just like the Arduino. Compared to the original library, Arduino-Lite generates smaller binaries and perform faster.

And now, we are honored to introduce the Arduino-Lite to the public, and to make it open source.

The open source version of Arduino-Lite can be downloaded at Google Code: http://code.google.com/p/arduino-lite/

This is the first one of the series articles. Detailed usage of Arduino-Lite will be posted soon.

0. Supported Devices

Besides the standard Arduino controller boards based on Atmega328/168, all third-party boards using the following AVR chips are supported. We also published a driver-less AVR/51 programmer called RP USB Connector which is used internally by RoboPeak Team. The firmware of RP USB Connector is also developed with the Arduino-Lite library.

1. Why yet another library, and why to use it

Arduino and Arduino-Lite are both written with C++/C, and based on avr-gcc, but the Arduino-Lite has some pretty advantages:

  • Very very lightweight

Most binaries based on Arduino-Lite are 50% smaller than which based on Arduino.

  • High Efficiency

Many functions provided by Arduino-Lite, such as DIGITAL_WRITE, which is equivalent to the digitalWrite in the Arduino, implemented by only one AVR instruction.

  • More AVR chips and frequencies are supported

Besides Atmega8(A), Atmega168(PA), Atmega328(PA), Atmega1280, Arduino-Lite also supports Attiny2313, Attiny26, Atmega48(PA), Atmega88(PA)

Working frequencies supported by Arduino-Lite are ranging from 1Mhz to 20Mhz.

However, Arduino-Lite advances in following features as well:

  • Self-contained, no third-party tools, compilers or libraries dependencies.

With Arduino-Lite, the only tool you need to develop, compile or burn to devices is the common text editor, which is delivered by most modern operating system.
Avr-gcc(WINAVR) and relative libraries comes with the Arduino-Lite package.

  • Flexible and easy-to-integrate Makefile-based compiling system, but no more Makefile composing or generating operations are required.

The easiest way to create a new Arduino-Lite project is decompress the template and rename it. You can place your code in any place in the project directory. And Arduino-Lite will compile your project properly. You don’t need to modify/compose/generate Makefile anymore.

Continue reading Arduino-Lite, Lightweight AVR library developed by RoboPeak(1)