raspberry pi 2 is tested in compressed air vessel working at 5bar

Recently, as a byproduct of exp work in Ox Uni,  I tested raspberry pi 2 works at 5 bar, it could work at higher pressure but not tested.

All the rpi 2 use no electrolytic capacitor (all components are supposed to be pressure tolerant), so it is potentially working at higher pressure than atm.  Now it is confirmed.

Also, UART (RT and TX) pins are used to communicate between two pi. It works with 1 meter cable at 115200. amplifier_HP_testing

Posted in Sensor | Leave a comment

Allyoyn 14.12 compiled on raspberry pi and ubuntu

ref:  blog.csdn.net/huangjuegeek/article/details/38515445

  1. get soruce code

$ sudo tar -zxvf alljoyn-suite-14.06.00_beta-src.tar.gz -C /opt

$ cd /opt

$ sudo mv alljoyn-suite-14.06.00_beta-src alljoyn-14.06

$ sudo chown -R pi:pi alljoyn-14.06/

$ export AJ_ROOT=/opt/alljoyn-14.06

  1. install needed pkg

sudo apt-get install build-essential

sudo apt-get install scons

sudo apt-get install git

sudo apt-get install curl

sudo apt-get install openssl

sudo apt-get install libssl-dev

sudo apt-get install libjson0

sudo apt-get install libjson0-dev


All future Raspbian images will ship with Oracle Java by default; existing users can install it by typing:

sudo apt-get update && sudo apt-get install oracle-java7-jdk


  1. setup java (optional)


sudo cp junit-4.10.jar /usr/share/java/

export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle-armhf

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:JAVA_HOME/lib/tools.jar:/usr/share/java/junit-4.10.jar

export PATH=$JAVA_HOME/bin:$PATH


  1. symbol link or export CROSS_COMPILE for rpi


sudo ln -s /usr/bin/gcc /usr/bin/arm-angstrom-linux-gnueabi-gcc

sudo ln -s /usr/bin/g++ /usr/bin/arm-angstrom-linux-gnueabi-g++

instead of doing this soft link, in 14.12, you need (if CROSS_COMPILE is not set):

$export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-

  1. Compile 14.06 and 14.12


cd $AJ_ROOT/core/alljoyn     # 14.06 rpi

scons OS=linux CPU=arm WS=off BINDINGS=cpp,java OE_BASE=/usr

cd $AJ_ROOT/     # 14.12 on Ubuntu

scons OS=linux CPU=x86 WS=off BINDINGS=cpp,java OE_BASE=/usr


  1. test it 14.12

it is different from 14.06, `bbdaemon`


#binary is not installed, but Export PATH and LD_LIB for future recompilation

export AJ_DIST=$AJ_ROOT/build/linux/x86/debug/dist/cpp

#export AJ_DIST=$AJ_ROOT/build/linux/arm/debug/dist/cpp

export PATH=$AJ_DIST/bin:$PATH



source ~./bashrc



#the compilation obj file is 1.5G total, considering to install and clean the file, if on rpi


#mv $AJ_ROOT/build/linux/arm/debug/dist ~/aj_dist

#scons clean #or# rm -rf $AJ_ROOT

export AJ_DIST=$HOME/aj_dist/cpp

export PATH=$AJ_DIST/bin:$PATH



7 cross-compilation: just install and set “linaro” CROSS_COMPILE

for A7 A8 cortex M


for rpi, need from

git clone https://github.com/raspberrypi/tools.git


  1. wireshark can monitoring this protocal
Posted in Ineternet of Things | Comments Off

using raspberry pi and beaglebone launchpad as USB-uart

note collected from internet source


Raspberry pi, uart should pin is enabled by default? yes

Raspberry Pi’s Mini-UART

Warning: Misleading information ahead – See Warren Gay’s comments.
The Raspberry Pi actually has two UARTs. One UART  is part of the internal ARM architecture of the Broadcom BCM2835 chip, in the core of the Raspberry Pi and not accessible externally.  The other UART is sometimes called the RPi’s “Serial Port” (even thou the USB supports serial communications, and therefore a serial port).  The serial port being reference here is serviced by a UART, sometime refereed to as the  “Mini-UART” since it doesn’t appear to be very rich in functionality.  It is basically be used as a console port for access to the Raspberry Pi.  The serial console is a convenient way to interact with the Raspberry Pi for debugging or your network is down and it is the destination of console messages (including boot-up messages).  From the Raspberry Pi pinout and the eLinux wiki, I can see that the serial port (aka Mini-UART) on the Pi is on GPIO Pin 14 (TX) and GPIO Pin 15 (RX):


Since the GPIO pins give access to the Mini UART, you can establish a serial console, which can be used to log in to the Pi, and many other things.  However, normal console device communicate with -12V (logical “1″) and +12V (logical “0″) RS-232, which may just fry something in the 3.3V Pi. Even “TTL level” serial at 5V runs the same risk.  See this tutorial for one example on how to build 3.3V to RS-232 levels converter with a MAX3232CPE and a few passive components.

You can reconfigure the RPi so that the Mini UART isn’t acting as a serial console and use it for outer purposes (e.g. communicate with an attached Arduino or Xbee).  Using the Raspberry Pi’s serial port requires some Linux reconfiguration and the abandonment of the serial console, and potentially some level conversion, but it could be useful. The Mini-UART pins to provide access to Linux’s /dev/ttyAMA0 serial port.  To be able to use the serial port to connect and talk to other devices, the serial port console login needs to be disabled and the post “Raspberry Pi and the Serial Port” shows you how.

Again, keep in mind that RX and TX lines are available on the GPIOs but operate at 3.3 volts. You’ll need a board or cable to level convert 3.3 volt UART signals to connect with other devices (e.g. RS-232, USB).

Disable Serial Port Login

To enable the serial port for your own use you need to disable login on the port. There are two files that need to be edited

The first and main one is /etc/inittab

This file has the command to enable the login prompt and this needs to be disabled. Edit the file and move to the end of the file. You will see a line similar to

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Disable it by adding a # character to the beginning. Save the file.

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Disable Bootup Info

When the Raspberry Pi boots up, all the bootup information is sent to the serial port. Disabling this bootup information is optional and you may want to leave this enabled as it is sometimes useful to see what is happening at bootup. If you have a device connected (i.e. Arduino) at bootup, it will receive this information over the serial port, so it is up to you to decide whether this is a problem or not.

You can disable it by editing the file /boot/cmdline.txt

The contents of the file look like this

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Remove all references to ttyAMA0 (which is the name of the serial port). The file will now look like this

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait


BBB has usbnet for quick conn

Launchpad G2553 is 9600 uart!

USB 2.0 to TTL UART 6PIN CP2102 Module Converter Connector Adaptor Cable UK



1.This is a USB 2.0 to TTL UART 6PIN CP2102 Module Serial Converter. Connect MCU easily to your computer!
2.Stable and reliable chipset CP2102
3.USB specification 2.0 compliant with full-speed 12Mbps.
4.Standard USB type A male and TTL 6pin connector. 6pins for 3.3V, RST, TXD, RXD, GND & 5V.
5.All handshaking and modem interface signals.
6. Baud rates: 300 bps to 1.5 Mbps.
7. Byte receive buffer; 640 byte transmit buffer.
8. Hardware or X-On/X-Off handshaking supported.
9. Event character support Line break transmission.
10.USB suspend states supported via SUSPEND pins.
11.Temperature Range: -40 to +85.
12.Supports Windows 98SE, 2000, XP, Vista, Window7, Mac OS 9, Mac OS X & Linux 2.40.


The Adafruit IO Python library will export the UART device tree overlays as a convenience. There are five serial ports brought to the expansion headers (UART3 only has a single direction, TX), and one (UART0, serial J1) with dedicated headers that aren’t available to use in your Python programs.



To setup and export the UART, you can do the following:

  1. import Adafruit_BBIO.UART as UART
  2. UART.setup(“UART1″)

That’s it!

Also, there is a cleanup() method ready to go, but it’s not currently working due to a bug in the kernel that causes kernel panics when unloading device tree overlays. We’ll update this when it’s working. A workaround is to either leave the UART enabled, or restart your BeagleBone Black.

Pin Table for UART



UART1 P9_26 P9_24 P9_20 P9_19 /dev/ttyO1
UART2 P9_22 P9_21 /dev/ttyO2
UART3 P9_42 P8_36 P8_34 /dev/ttyO3
UART4 P9_11 P9_13 P8_35 P8_33 /dev/ttyO4
UART5 P8_38 P8_37 P8_31 P8_32 /dev/ttyO5

Using UART with Python

You can use the pyserial module in Python, but you’ll first need to install it using pip. If you don’t have pip installed, you can follow the instructions on the installation pages for this tutorial.

SSH into the BeagleBone Black, and execute the following command:

  1. pip install pyserial

Below is a very simple python program that is a good starting point. Save it to a file, and execute it with ‘python file_name.py’

  1. import Adafruit_BBIO.UART as UART
  2. import serial
  3. UART.setup(“UART1″)
  4. ser = serial.Serial(port = “/dev/ttyO1″, baudrate=9600)
  5. ser.close()
  6. ser.open()
  7. if ser.isOpen():
  8.   print “Serial is open!”
  9.         ser.write(“Hello World!”)
  10. ser.close()
  11. # Eventually, you’ll want to clean up, but leave this commented for now,
  12. # as it doesn’t work yet
  13. #UART.cleanup()

Testing and Using the UART

You can easily test that everything is working, without having to code anything, or installing any other dependencies to get started.

Next, you’ll want to connect two wires to the UART pins. We’re just going to cross the RX/TX of the UART1 and UART2. The first wire should connect from P9_24 to P9_22. The second wire should connect from P9_26 to P9_21.

Next, export the UART1 and UART2 in the python interpreter with the Adafruit IO library:

  1. root@beaglebone:~# python
  2. Python 2.7.3 (default, May 29 2013, 21:25:00)
  3. [GCC 4.7.3 20130205 (prerelease)] on linux2
  4. Type “help”, “copyright”, “credits” or “license” for more information.
  5. >>> import Adafruit_BBIO.UART as UART
  6. >>> UART.setup(“UART1″)
  7. >>> UART.setup(“UART2″)
  8. >>> exit()

Once you’ve done that, execute the following commands to launch minicom (using two separate ssh sessions using your terminal of choice, mine are separated by tabs in OS X):

  1. #first terminal window:
  2. minicom -b 9600 -D /dev/ttyO1
  3. #second terminal window:
  4. minicom -b 9600 -D /dev/ttyO2

It should look like this once you’ve opened minicom:

Now, type in one of the terminal windows, and hit enter. Look at the other terminal, and you should see something like this:

You can exit from minicom by typing Ctrl-A, then Z, then X, and hit enter at the dialog.


Posted in Uncategorized | 1 Comment


序: 今吾留学已逾二载,尚且彷徨。观乎同辈,或有身兼中西之学,文理书乐皆通,踌躇满志者,窃以为不如。 吾温顺静思,非浪荡轻浮之人,奈何拘于家学见闻。究其根本,盖教育环境之异。








谋 国之举,一代难成;佐国之臣,出于当世;鸿儒巨硕,自励自成。王莽篡国,三代之力;三国鼎立,各有家承。然煮酒论英雄之时,袁绍承四世三公之势,虎踞冀州 之地,曹操不以英雄论之,何也?善始不必善成,非有能者不能成其大。乱世出英豪,时势造英雄。刘邦布衣起家,而夺项王之天下。朱元璋由卑至尊,今谓之草根 皇帝。北宋一代,治世能臣多出寒门。自古大儒多出寒门。穷则益坚,安贫知命,不为逢迎攀比而劳身,虚名福利损命。

家世显赫,乃生之幸,非众人之福;良师益友,世人皆可寻而得之。 盖今世之教育,童蒙重在家教,小学贵在师严,中学益在志高,大学旨在求索。 所闻所见所识所能,皆可后天补养,所需者,时也!

而立之年吾志方立,其晚乎?尽人事而听天命。 诚能守一毅行,去躁守静,当有所成。


Posted in 时评随笔 | Comments Off


最近中国公司阿里巴巴成功登陆了纽交所,不少人觉得这是一 件很光荣的事,毕竟阿里创造了美国历史上最大一笔IPO纪录,对一个中国企业实属不易。同时,我也认为这对中国金融体系以及中国广大投资者,这是一个悲 哀。中国是世界上储蓄率最高的国家之一,老百姓现在也急需很好的投资产品,遗憾的是大多数中国投资者都没有办法买到阿里巴巴的股票,阿里巴巴还要不远万里 到美国跨过制度、法律、语言的各种障碍寻求上市。

从中国金融体系角度来看,这种情况为什么会发生?你可以说是美国金融体系或者美国金融市场 具有很大的吸引力,他们拥有非常有效的制度和规则,而中国在这一点上望尘莫及。美国金融市场有两个特点,其一是其筛选功能,将一些非常优秀的创业型企业从 众多的企业里挑选出来交给投资者,筛选的能力很强;其二是市场监督的机制,不仅可以把企业甄选出来,而且还可以让企业选择适合它们需求的治理和管理体系, 这既能够满足企业治理模式和融资需求,同时又能够保护好投资者。

众所周知,阿里巴巴起先想在香港上市,但香港联交所并没有同意,因为阿里有 一套治理结构,比如说合伙人要主导董事会成员的提名权,这个其实在美国市场也存在一定风险,但是美国市场接受了阿里巴巴,因为美国相信在公司治理上它还是 有其他的方法来保护投资者,例如它的法律制度的一些安排是能够更好地保护到它的投资者。相较于中国大陆甚至香港的金融市场,美国金融体系具备很大优势。这 一问题就牵涉到中国金融体系改革的战略抉择问题,中国不光是阿里巴巴一家在境外上市,类似优质的企业现在已经有几家了,比如腾讯、京东等等,中国的老百姓 不能够享有这些优秀企业成长中的投资机会。

在经济“新常态”下,今后五到十年中国整个经济转型的过程中,会涌现出一批有中国特色的、引领世 界潮流的创新型的企业,而这些企业今后到哪里融资,对这些企业中国的老百姓能不能投资,是中国金融体系改革亟需要关注的一点。如果在今后五到十年这些企业 还是跑到美国去上市,这就不是一个悲哀的问题了,我觉得那会是一个耻辱,我相信这种压力肯定会要倒逼中国金融体系有更大更快的变革。目前关键的问题就是中 国下一步金融体系要怎么改?在我看来未来可能会有三种情景,而且这三种情景取决于国内的金融制度改革的战略选择。

第 一种情景,大多数优秀的中国企业继续在美国上市,在中国投资者的压力下,中国的资本账户会有更大的开放,允许中国的投资者有更多的钱可以兑换成美元,到美 国市场上进行投资。中国实体经济对外投融资巨大的需求正在倒逼资本账户的开放,最近几年中国央行也在推动资本账户下可兑换,我相信今后几年会有很快的进 展。但如果在这个情景下,中国没有开发出能吸引自己企业的融资平台,中国的融资投资就只能通过美国市场(或其他国际市场)来运作,于是美国金融市场成为了 中国这些新型创新型企业的投资银行,这个结果肯定不是大家想要看到的。更进一步,这存在两个问题,一是中国有很多投资者,资金在中国,同时还是中国企业需 要融资,但是要到美国去才能做这件事情,交易成本就会非常高,这个肯定不是最优的解决方案。还有一些企业甚至国际化程度没有像阿里巴巴这么高,可能还走不 到美国去,融资就很困难,这就是我们讲的中小企业融资难的问题。二是汇率风险和国家风险,中国企业都在美国融资,而中国企业需要的都是人民币,中国投资者 到美国投资,最后也还是需要人民币,这里就存在汇率风险的问题;这些企业的融资都是在与国内各种制度完全不同的国家进行,肯定也有各种各样的国家和政治风 险。

第二种情景,中国企业去香港上市,中国现在有不少企业这么做,比如腾讯。香港市场相对来说离中国比较接近,而它的制度、资本市场的成熟 度、为金融企业服务的程度、公司治理的监管以及对投资者的保护都比大陆发展得要好。当然,香港市场的上市制度也存在某些限制,比如香港市场也有汇率问题, 至少现在港币是紧盯美元的,同时也有制度的风险。最近沪港通、深港通都在筹备当中,可能也是希望在这个方面起到一定的作用。如果香港成为重要的人民币离岸 市场,投融资也用人民币来计价,这种情景相比第一种情景对中国内地的投资者和融资企业风险和成本都要低一点,但是这毕竟不是最优的。更重要的是人民币金融 市场的定价权是不应该由一个离岸市场来主导的。

第三种情景,在中国的某一个地方打造一个具有国际水平的、比较开放的金融市场,按照人民币来 计价,让中国众多的投资者和需要融资的企业的投融资需求可以在境内得到满足。可能大家觉得这个情景还是天方夜谭,但是我觉得不完全是,而且我相信只要有开 放和改革的勇气,这在今后十年是可以实现的。上海自由贸易试验区的设立和实践就是为了在投融资便利、制度创新上发挥更大作用,所以我觉得有很多事情是可以 放到上海自贸区来实现的,中国的投资者缺乏投资品种,大量的融资者也在中国,但是没有好的市场把他们撮合在一起。说到底这是一个制度的问题,所以需要有制 度上的创新。

举一个可以创新的例子,中国现在非常缺的市场是中长期债券市场,中国的中长期发债方只有那些风险较小、信用评级较高的大企业。 如何为中国的中小企业提供一个平台,让他们也有中长期的债券融资的可能,而且还要能规避国内的所谓刚性兑付的潜规则?我认为,在自贸区发展这样的高收益债 券市场是一个很好的选择,为什么这样说?自贸区是对外开放的,债券市场开始可以主要引进境外持人民币的投资者,让境外投资者按照国际规则来进行风险定价, 该破产就破产,这样就可以打破刚性兑付的潜规则。这个债券市场要用人民币定价和结算,并通过自贸区已基本建成的分账户核算体系,逐渐地开放与境内账户的渗 透的程度让境内和境外互通,最后境内的投资者也可以没有限制地买这些债券。这样一个平台的建立是对中国的金融体系制度上的创新,真正能够为中国的投资者和 融资者服务,同时也能够推动人民币的国际化。而要实现这样一个平台关键是相关监管部门要看到中国整个金融体系的改革发展的大趋势,不要再为部门的利益而扯 皮,因为时间已经非常紧迫,今后五到十年中国会有一大批企业需要这样的服务,而如果中国市场不提供这样的服务,这些企业就会投奔美国或香港金融市场了。




1. 阿里巴巴在美国IPO居然是中国错失网络盛宴的证明?

Posted in 时评随笔 | Comments Off

SCITE as nodejs groovy and qml (qtquick 2.0) c++11 IDE

in cpp.properties global setting file (sudo scite on  Linux)

#at the begining of this config file:



##############add for C++11 mingw32##########

#add more header and lib file path to support third party lib

cpluspluspts= -pedantic  -Os   -std=c++11  -I D:\Software\mingw64\include -L D:\Software\mingw64\lib

# support only single file compile directly into binary, no makefile is needed
cc=$(GCCPATH)\g++ $(ccopts)  -c $(FileNameExt) -o $(FileName).o

#################modify #####################
command.compile.$(file.patterns.cplusplus)=$(GCCPATH)\g++ $(cpluspluspts) $(FileNameExt) -o $(FileName)
command.go.$(file.patterns.cplusplus)=PATH $(GCCPATH);%PATH%  &&  $(FileName)
command.go.needs.$(file.patterns.cplusplus)=$(GCCPATH)\g++ $(cpluspluspts) $(FileNameExt) -o $(FileName)

##################add ######################
command.go.*.js=node.exe $(FileNameExt)
#es6 is not standard file suffix
command.go.*.js6=node.exe  –harmony $(FileNameExt)
command.go.*.qml=PATH $(QT5PATH) && qmlscene  $(FileNameExt)
#if it does not work, ->  start qmlscene from Qt for desktop command prompt!
#tab openning needs to be adjusted,  append *.groovy    to java pattern for the timebeing
#script need not compile and make
#command.compile.*.groovy=groovyc $(FileNameExt)
command.go.*.groovy=groovy $(FileNameExt)

Posted in Uncategorized | Comments Off

Using matplotlib to plot NI DAQmx data file (big data)

Due to the recent research requirement, I need to replot and analysis signal of high sampling rate (several mega samples per seconds) with PCIe card.

I planned to use numpy and matplotlib to plot, but I was a bit worried on the capability of using npTDMS and matplotlib to processing big data (100MB to 1GB, but big data in modern sense)

A quick test shows it works (to draw array of several mega samples), seems not worse than NI AIdem for visualization, all subject to serious delay during zooming in. However, the loading is much slower,  as npTDMS is pure python, not C API implemented.

And the program just consume as little memory as it is on disk size.

Continue reading

Posted in Uncategorized | Comments Off

using OpenCV in Qt4 GUI using python

This python read from webcam and display into Qt4 widget(not highGUI) code is adapted from example code from : #http://wrdeoftheday.com/?page_id=2

since not all source code is attached, I complete the code and make it available for downland. This can serve as a better starting point for more complicated app.

zip password: iesensor.com

zip file:  qtcvpy

Continue reading

Posted in Programming | Comments Off

beaglebone black debian wheezy usb net configuration and ssh login on windows and Linux


follow the tutorial and make usbnet boot automatically

on my BBB debian wheezy:

sudo cat  /etc/modprobe.d/usbnet.conf

#auto load usbnet
options g_multi file=/usbnet.img stall=0
#there is a usbnet.img already there under /

Continue reading

Posted in Uncategorized | Comments Off

batch post-Process Ansys Fluent CFD Case And Plot In Python using Matplotlib or Tecplot


1. parse the ansys fluent profile text file into python list of dict;  draw velocity profiles by matplatlib (“see source code of draw_profile.py”)

2. generate tecplot batch and macro file to draw contours automatically in batch mode.  (see “vizCFDbytecplot.py”)

download the source file here,


I hope it can inspire you, but it will not serve you directly.

Edit some variables at the beginning of source code should make it work for you.

you need to record your own tecplot macro to style the plot.




Qingfeng Xia  2013

“CFD study of synthetic jet at low Reynolds numbers”

University of Manchester


Posted in Programming, Research | Comments Off

solutions for python pip install gcc compilation error: -mno-cygwin


(1)install unofficial python extension package  binary installer

Unofficial Windows Binaries for Python Extension Packages

by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.


MinGWmay be not compatible with python pip compiler:   -mno-cygwin
remove the official mingw from path. or install mingw built for python

Windows GCC (MinGW) binaries for Python developers  gcc4.3


(3) Remove the  -mno-cygwin  option

-mno-cygwin in Python\Lib\distutils\cygwinccompiler.py causes this problem: see Compiling with cython and mingw produces gcc: error: unrecognized command line option ‘-mno-cygwin’ or http://korbinin.blogspot.com/2013/03/cython-mno-cygwin-problems.html.

My Python distribution (Anaconda)’s cygwinccompiler.py does not have that though. Anyway, after removing all -mno-cygwin in the definition of the Mingw32CCompiler class you should be able to compile.

Posted in Uncategorized | Comments Off

Recommend RT-Thread RTOS to Linux programmers

In a nutshell, Linux programmers will love RT-Thread API.
  1. Thread in RT-Thread works like  POSIX thread:  #include <posix_types.h>
  2. Each thread has TCB (task control block),  like Linux kernel thread, share the global memory, but has its own stack (pre-decleared array with fixed size), has event and timer for each thread;  Thescheduler, which uses bitmap algorithm,  is similar with Linux kernel
  3. RT-Thread is high performance RTOS, mainly focusing on ARM cortex-M 32bit CPU.
  4. RTGUI/FTK   (object-oriented style widget,  just like GTK+)
  5. Device model like Linux device tree.
  6. IPv4 and IPv6 are supported by lwIP lib with <socket.h>, but 6LowPAN is not supported as Contiki.
  7. Simulator on Linux and Windows (32bit  x86 only) and good documentation.
  8. Python scons building system; but it is easier than Makefile to control multiple targets building.

Most important, it is free even  for commercial usage, via applying free license and keep RT-thread banner.

Finally, this is the host place:  https://github.com/RT-Thread

Posted in Uncategorized | Comments Off

Software SPI library for Arduino tested on Mega2560

Since there is only one hardware SPI, but it is used by Ethernet or Wifi shield. If you wantto conenct some other sensors via SPI, the Ethernet lib is reluctant to cooperate.

So a software bit-banging library may be necessary.

Four SPI modes are supported, just change the macro definition in header file.

Continue reading

Posted in Uncategorized | Comments Off

[notes]Arduino IDE can NOT include libraries within project subfolders

The IDE requires every file to be in the same directory as the main program!

Continue reading

Posted in Uncategorized | Comments Off

Setup Codelite to work with visual studio toolset

I am tired to upload figures , I just give it as PDF file with figures inside

Setup Codelite to work with visual studio toolset (totorial version)

Posted in Uncategorized | Comments Off

python pinyin module support simplified and traditional chinese codecs

git clone https://github.com/qingfengxia/pinyin.py.git

Pinyin python module

Origin:      Author:cleverdeng      E-mail:clverdeng@gmail.com (not reachable)

forked by Qingfeng Xia based on v0.9:  
               (1)renamed class name from PinYin to Pinyin, 
               (2)dict file "word.data"  is  renamed  as "pinyin.data" 
               (3) add encoding support, or it will not work for windows cmd prompt! 
               (4) move load_word() (renamed as loaddict() ) into __init__(), to make API concise
               (5) word.data  "ord(UNICODE)= list of pinyin", for quick loading and human readable check
                  why some unicode has multiple pinyin units??? 

               copy the two files:  pinyin.py, pinyin.data , into your project folder, or under $PYTHONPATH , or your sitepackages

test:   testing code is under __main__ section
               python -m pinyin.py

 Continue reading 
Posted in Download, Programming | Comments Off

Comparsion of DateTime classes in popular programming Languages (2)

as a further explanation to:

” Comparsion of DateTime classes in popular programming Languages (1)”

This part is a copy and paste of lang/lib spec.

Continue reading

Posted in Programming | Comments Off

Comparsion of DateTime classes in popular programming Languages (1)

C    boost::Datetime  Java JDK8(javax.time)  Qt Python and Javascript

(1) Table comparison

(2) Further explanation from each language spec

Joda package for (Java) is not described here, whose API is analoguous to Qt and Python. As there is new API of LocalDateTime,  it is the equivalent to QDatetime, and python’s datetime.

Table: Comparsion of DateTime classes in popular programming Languages

Author: Qingfeng Xia  2014    Versioin 0.2             http://www.iesensor.com


python std lib datetime is mutable!

C++11 <chrono> limitations: 1) no datetime class,  2) no time zone

Java: javax.time (nave before release of java 8) -> java.time (final name)


see attached word doc

Table Comparison of DateTime classes in popular programming Languages

Continue reading

Posted in Programming | Comments Off

You must know C++11, but have you noticed C11?

Previous C++ standard is C++03 (2003); previous C std is C99.They are not released together, but they did this time as  a combo of C11 and C++11.

__STDC_VERSION__ == 201112L

C11 (formerly C1X) is an informal name for ISO/IEC 9899:2011  (see wiki)


Continue reading

Posted in Programming | Comments Off

Four wheel car robot based on Arduino Mega2560 and Raspberry Pi

git clone https://github.com/qingfengxia/arduinorobotcar.git

Datasheets (most of them in Chinedse) for robot parts makes the git size big


Recently, I have been working on Arduino 2/4 wheel car robot in my spare time.

===============design goals==================

Robot car composing 4 DCMotors, Senors, ServoArm, BlueTooth remote control

Phase 1:
(1)   two/four wheel driving car steering,
There is no designated positive or negative pole for DC motor,  swapping pin1 and pin2 can made motor rotate reversely

Phase 2:
(2) sensors:  using  PID for sensor fusion ,
a)  altrasound range sensors included
b)  acceleration or angle speed
c) Infrared receiver
(3) Control by Infrared remote or PC control via bluetooth

Phase 3:
(4)  usb Camera supervision using Raspberry Pi usb wifi
(5) voice command recogniation by raspberry Pi connected to internet

Continue reading

Posted in Programming, Robot | Comments Off