本帖最后由 涼山海 于 2013-6-26 11:48 编辑
老摸 发表于 2013-6-26 10:43 
太漂亮了!
也许公共脚接反了呢?
和一个搞电路师傅的人说,他说是我这个是四位共阴/共阳数码管!!! 所以这个LOW 和 HIGH 都是定死的,
如果我只是要显单色之间的转换, 如:
void mainColors()
{
// Off (all LEDs off):
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, LOW);
delay(1000);
// Red (turn just the red LED on):
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
digitalWrite(BLUE_PIN, HIGH);
这我编程时候就把 HIGH 和 LOW 替换下就好了,
可如果我要用 showSpectrum 和 show RGB 的指令:
if (color <= 255) // zone 1
{
redIntensity = 255 - color; // red goes from on to off
greenIntensity = color; // green goes from off to on
blueIntensity = 0; // blue is always off
}
这数据我不是得反着写。。。。太复杂了啊。。。
怎么办啊! |