参考官方代码[AppleScript]
纯文本查看 复制代码
if((0x03 & reg_r_data[0]) >= 0x02){LED1 = 0;} //CS1 touchelse{LED1 = 1;}if((0x03 & (reg_r_data[0] >> 2)) >= 0x02){LED2 = 0;}//CS2 touchelse{LED2 = 1;}if((0x03 & (reg_r_data[0] >> 4)) >= 0x02){LED3 = 0;}//CS3 touchelse{LED3 = 1;}if((0x03 & (reg_r_data[0] >> 6)) >= 0x02){LED4 = 0;}//CS4 touchelse{LED4 = 1;}if((0x03 & reg_r_data[1]) >= 0x02){LED5 = 0;}//CS5 touchelse{LED5 = 1;}if((0x03 & (reg_r_data[1] >> 2)) >= 0x02){LED6 = 0;}//CS6 touchelse{LED6 = 1;}if((0x03 & (reg_r_data[1] >> 4)) >= 0x02){LED7 = 0;}//CS7 touchelse{LED7 = 1;}if((0x03 & (reg_r_data[1] >> 6)) >= 0x02){LED8 = 0;}//CS8 touchelse{LED8 = 1;}if((0x03 & reg_r_data[2]) >= 0x02){LED9 = 0;}//CS9 touchelse{LED9 = 1;}if((0x03 & (reg_r_data[2] >> 2)) >= 0x02){LED10 = 0;}//CS10 touchelse{LED10 = 1;}if((0x03 & (reg_r_data[2] >> 4)) >= 0x02){LED11 = 0;}//CS11 touchelse{LED11 = 1;}if((0x03 & (reg_r_data[2] >> 6)) >= 0x02){LED12 = 0;}//CS12 touchelse{LED12 = 1;}if((0x03 & reg_r_data[3]) >= 0x02){LED13 = 0;}//CS13 touchelse{LED13 = 1;}if((0x03 & (reg_r_data[3] >> 2)) >= 0x02){LED14 = 0;}//CS14 touchelse{LED14 = 1;}if((0x03 & (reg_r_data[3] >> 4)) >= 0x02){LED15 = 0;}//CS15 touchelse{LED15 = 1;}if((0x03 & (reg_r_data[3] >> 6)) >= 0x02){LED16 = 0;}//CS16 touchelse{LED16 = 1;}
采集的数据用灯的亮灭表示,现在是触摸一个通道,其他的也会亮灭,受影响较大
output采集到的数据不稳定,相邻通道会干扰。有什么办法吗
参考官方代码[AppleScript] 纯文本查看 复制代码
if((0x03 & reg_r_data[0]) >= 0x02){LED1 = 0;} //CS1 touchelse{LED1 = 1;}if((0x03 & (reg_r_data[0] >> 2)) >= 0x02){LED2 = 0;}//CS2 touchelse{LED2 = 1;}if((0x03 & (reg_r_data[0] >> 4)) >= 0x02){LED3 = 0;}//CS3 touchelse{LED3 = 1;}if((0x03 & (reg_r_data[0] >> 6)) >= 0x02){LED4 = 0;}//CS4 touchelse{LED4 = 1;}if((0x03 & reg_r_data[1]) >= 0x02){LED5 = 0;}//CS5 touchelse{LED5 = 1;}if((0x03 & (reg_r_data[1] >> 2)) >= 0x02){LED6 = 0;}//CS6 touchelse{LED6 = 1;}if((0x03 & (reg_r_data[1] >> 4)) >= 0x02){LED7 = 0;}//CS7 touchelse{LED7 = 1;}if((0x03 & (reg_r_data[1] >> 6)) >= 0x02){LED8 = 0;}//CS8 touchelse{LED8 = 1;}if((0x03 & reg_r_data[2]) >= 0x02){LED9 = 0;}//CS9 touchelse{LED9 = 1;}if((0x03 & (reg_r_data[2] >> 2)) >= 0x02){LED10 = 0;}//CS10 touchelse{LED10 = 1;}if((0x03 & (reg_r_data[2] >> 4)) >= 0x02){LED11 = 0;}//CS11 touchelse{LED11 = 1;}if((0x03 & (reg_r_data[2] >> 6)) >= 0x02){LED12 = 0;}//CS12 touchelse{LED12 = 1;}if((0x03 & reg_r_data[3]) >= 0x02){LED13 = 0;}//CS13 touchelse{LED13 = 1;}if((0x03 & (reg_r_data[3] >> 2)) >= 0x02){LED14 = 0;}//CS14 touchelse{LED14 = 1;}if((0x03 & (reg_r_data[3] >> 4)) >= 0x02){LED15 = 0;}//CS15 touchelse{LED15 = 1;}if((0x03 & (reg_r_data[3] >> 6)) >= 0x02){LED16 = 0;}//CS16 touchelse{LED16 = 1;}
采集的数据用灯的亮灭表示,现在是触摸一个通道,其他的也会亮灭,受影响较大
output采集到的数据不稳定,相邻通道会干扰。有什么办法吗
举报