[原创]通过Raspberry Pi(树莓派)的GPIO接口控制步进电机/Control stepper motor through the GPIO on Raspberry Pi

转载请注明出处:http://www.codelast.com/

Raspberry Pi是什么?
引用维基百科的一句话:

The Raspberry Pi is a credit card sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools.

简单地说,它就是一个基于ARM CPU的、信用卡那么大的迷你计算机。
In short, Pi is an ARM-based mini computer which has a credit card size.

在阅读本文之前,请确保你已经阅读过我的另外几篇关于Pi的文章,因为本文与它们有或多或少的关系。
Before reading this article, please make sure that you've read some other articles of mine on Pi, because this article is more or less based on them.

【1】实验目的 / Experiment purpose
在树莓派上编写一个C程序,通过其GPIO口控制步进电机的转动方向以及速度。
Write a C program to control the direction & speed of rotation of a stepper motor through the GPIO on Raspberry Pi.
阅读更多

[原创]通过Raspberry Pi(树莓派)的GPIO接口控制发光二极管/Control LED through the GPIO on Raspberry Pi

转载请注明出处:http://www.codelast.com/

Raspberry Pi是什么?
引用维基百科的一句话:

The Raspberry Pi is a credit card sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools.

简单地说,它就是一个基于ARM CPU的、信用卡那么大的迷你计算机。
In short, Pi is an ARM-based mini computer which has a credit card size.

在阅读本文之前,请确保你已经阅读过我的另外几篇关于Pi的文章,因为本文与它们有或多或少的关系。
Before reading this article, please make sure that you've read some other articles of mine on Pi, because this article is more or less based on them.

通过Raspberry Pi的GPIO口来控制发光二极管已经不是什么新鲜事了,网上有大量的教程和资源可查。为了测试一下控制GPIO输出的功能,我也实践了一次。
首先声明,我对硬件并不了解,所以下文可能有错误,如果你发现了,请留言告诉我,非常感谢。
It's nothing new to control LEDs through Pi's GPIO, a lot of tutorials & resources are available on the Internet now. But I tried to do it myself too for the sake of testing the GPI output functionality.
First I want to remind the readers that I'm not a hardware guy so this article may contains some mistakes, and if you find that, please leave comments to tell me, thanks in advance.

文章来源:http://www.codelast.com/
【1】实验目的 / Experiment purpose
写一个简单的程序,控制Raspberry Pi的GPIO口输出高、低电平,从而让接在GPIO口上的发光二极管闪烁。
Write a simple program to control the GPIO on Pi to output high or low level to make the LED which connected to GPIO blink.
阅读更多

[原创]Java基础知识记录(1)

前言:本文『很傻很天真』,任何稍有Java编程经验的都不用看了。

 

(1)Java文件编译得到class文件,jar包是若干class文件(以及其他一些文件)的集合,如果要在命令行运行jar包中的一个class文件(相当于一个Java程序),可以这样做:

java -cp /root/software/tmp/XXX.jar:/root/software/tmp/lib/* com.abc.calculate.MyClass --date 20101101

其中,-cp 表示指定classpath,后面需要以分号(:)分隔的方式将所有需要用到的依赖jar包添加进来,此处添加了 /root/software/tmp/XXX.jar 包以及 /root/software/tmp/lib/ 目录下的所有jar包。

com.abc.calculate.MyClass 是要运行的jar包 XXX.jar 中的一个class文件,这么长的名字是它在jar包中的路径全名。

--date是传给 MyClass 程序命令行参数。还可以带更多的参数,要看你在Java程序中是如何写的代码。

阅读更多