树莓派只有一路硬件PWM输出(GPIO1),可是要实现RGB LED的控制,需要3路PWM。其实,wiringPi库为我们提供了用软件多线程实现的PWM输出,我们可以利用这个库提供的函数很方便的将任意GPIO配置为PWM输出。在本例中,我将GPIO0,GPIO1,GPIO2配置成了soft PWM输出。...
分类:
其他好文 时间:
2014-08-09 18:51:48
阅读次数:
443
球与圆很相关,一个是三维,一个是二维,可以参考下:圆,椭圆(1)sphere的第一种写法vertices = D1:100 D2:100t = from 0 to (PI*2) D1r = from 0 to 1 D2x = 2*r*sin(t)*sqrt(1-r^2)y = 2*r*cos(t)*...
分类:
其他好文 时间:
2014-08-09 15:52:28
阅读次数:
301
圆vertices = 360w = from 0 to (2*PI)r = 10.0x = r*sin(w)y = r*cos(w)圆面,面上有纹理坐标,有顶点色vertices = D1:360 D2:100u = from 0 to (2*PI) D1v = from 0 to 10 D2x ...
分类:
其他好文 时间:
2014-08-09 15:50:08
阅读次数:
246
(1)圆柱面vertices = dimension1:72 dimension2:72u = from 0 to (2*PI) dimension1v = from (-5) to (5) dimension2r = 5x = r*cos(u)y = vz = r*sin(u)(2)任意角度圆柱面...
分类:
其他好文 时间:
2014-08-09 15:49:18
阅读次数:
316
(1)圆环vertices = D1:72 D2:72u = from 0 to (2*PI) D1v = from 0 to (2*PI) D2 r = 3*cos(u) + 7 z = 3*sin(u)y = r*sin(v)x = r*cos(v) y = y + 5(2)随机半径的圆环这里提...
分类:
其他好文 时间:
2014-08-09 15:48:38
阅读次数:
339
(1)螺旋管vertices = D1:720 D2:72u = from 0 to (10*PI) D1v = from 0 to (2*PI) D2a = 3x = (a + cos(v)) * cos(u)z = (a + cos(v)) * sin(u)y = sin(v) + u(2)螺旋...
分类:
其他好文 时间:
2014-08-09 15:48:28
阅读次数:
322
(1)圆锥面vertices = dimension1:72 dimension2:72u = from 0 to (2*PI) dimension1v = from (-5) to (5) dimension2x = v*cos(u)y = vz = v*sin(u)(2)椭圆锥面#http://...
分类:
其他好文 时间:
2014-08-09 15:47:48
阅读次数:
310
UvaLive6662PDF题目题意:给出隧道长度L,蚂蚁数量N,各蚂蚁位置Pi、前进方向Di,都为整数(前进方向为L或R),蚂蚁速度为1cm每秒,两蚂蚁若在整数点相遇则都反向,若不在整数点相遇则继续向前。求最后一个走出隧道的蚂蚁的编号。蚂蚁按编号1~n给出,隧道头尾位置为0和L。题解:模拟。当然我...
分类:
其他好文 时间:
2014-08-08 23:38:56
阅读次数:
337
目录 MathRandomDateCarlendarDateFormatSimpleDateFoematComparatorCloneMath System.out.println("PI的值:"+Math.PI); System.out.println("-10的绝对值:"+Math...
分类:
编程语言 时间:
2014-08-08 20:55:26
阅读次数:
371
中文题啊中文题,每次看到都是很兴奋的~
题目大意:自己看,全是中文~
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define eps 1e-6
#define pi acos(-1.0)
#define i...
分类:
其他好文 时间:
2014-08-08 16:03:56
阅读次数:
192