hogc / esp8266_gizwits_dc1 Goto Github PK
View Code? Open in Web Editor NEWesp8266 机智云智能排插
esp8266 机智云智能排插
希望总开关能单独控制USB
APP是搞定了
但是实体按键有些问题
依次打开 开关1,开关2,开关3
当按下总开关时 则所有开关关闭,再次按下总开关,USB打开,再次按下USB关闭
void ICACHE_FLASH_ATTR reverse_switch(uint16_t switch_ret,uint8_t num){
uint16_t switch_bit=0x10;
uart0_sendStr("switch_ret:%02x",switch_ret);
if(num == 0){
logo_led_switch(1);
if(dc1_write_gpio((switch_ret ^ 0x80) & 0x80)){
if((switch_ret & 0x80) == 0x80){
logo_led_switch(0);
}else{
logo_led_switch(1);
}
}
}else{
switch_bit=switch_bit<<(3-num);
switch_ret = switch_ret ^ switch_bit;
if(dc1_write_gpio(switch_ret & 0xF0 | 0x80)){
//logo_led_switch(1);
}
}
}
改成
void ICACHE_FLASH_ATTR reverse_switch(uint16_t switch_ret,uint8_t num){
uint16_t switch_bit=0x10;
switch_bit=switch_bit<<(3-num);
switch_ret = switch_ret ^ switch_bit;
if(dc1_write_gpio(switch_ret & 0xf0 | 0x80)){
//logo_led_switch(1);
}
}
之后,则总开关失效
看了下代码逻辑可能是要修改DC1KeyHandle函数
对平时主要玩C#对C/C++编程不是很懂...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.