Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Beannachtaí do léitheoirí uile na rannóige “DIY or Do It Yourself” ar Habr! Beidh alt an lae inniu mar gheall ar an lasc tadhaill ar an sliseanna TTP223 | Bileog sonraí. Feidhmíonn an lasc ar an microcontroller nRF52832 | Bileog sonraí, baineadh úsáid as modúl YJ-17103 le antenna clóite agus cónascaire le haghaidh antenna seachtrach MHF4. Feidhmíonn an lasc tadhaill ar chadhnraí CR2430 nó CR2450. Níl an tomhaltas i mód tarchuir níos mó ná 8 mA, sa mhód codlata nach mó ná 6 µA.
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Cosúil le gach tionscadal roimhe seo, is tionscadal Arduino é an ceann seo freisin, tá an clár scríofa san Arduino IDE. Tá cur i bhfeidhm bogearraí na feiste bunaithe ar phrótacal Mysensors | Leabharlanna GitHub, tacaíocht boird nRF5 GitHub i Misinéirí. fóram pobail Béarla - http://forum.mysensors.org, fóram pobail na Rúise - http://mysensors.ru/forum/
(Dóibh siúd ar mian leo staidéar a dhéanamh - Doiciméadú, Prótacal Srathach, API, Prótacal, parsálaí | dóibh siúd ar mian leo cabhrú (ranníocaíochtaí) i bhforbairt an tionscadail - Doiciméadú)

Forbraíodh an lasc-chlár tadhaill sa chlár Deeptrace, ag cur san áireamh déantúsaíocht ina dhiaidh sin ag baint úsáide as an modh Teicneolaíocht Iarnáil Léasair (LUT). Forbraíodh an bord i toisí 60x60mm (tá toisí 80x80mm ag painéal gloine caighdeánach). Clóbhuaileadh an ciorcad ar leathanaigh na hirise Antenna agus aistríodh é le iarann ​​Bosch leis an socrú “Len” (uaschumhacht) ar chlár snáithín gloine scragall dhá thaobh 1.5mm, 35µm (in éagmais ceann eile).
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Rinneadh eitseáil le tuaslagán de chlóiríd ferric, a ullmhaíodh roimhe seo i gcionmhaireachtaí 1.5 taespúnóg in aghaidh an 250 ml d'uisce te. Thóg an próiseas 15 nóiméad.
Rinneadh poill druileála le haghaidh vias idirchiseal agus chun sealbhóir na ceallraí a cheangal le miondruileáil DREMEL 3000 a bhí suite ar sheastán druileála DREMEL 220. Druileáladh poill le haghaidh vias idirchiseal le druil 0,4mm, poill don sealbhóir ceallraí le druil 1,1mm. . Rinneadh bearradh feadh theorainneacha an bhoird leis an miondruileáil céanna le ceangaltán DREMEL 540 (Ciorcal gearrtha d = 32.0mm). Rinneadh an bearradh i análóir.
Baineadh úsáid as cóimhiotal Rose i dtuaslagán uiscí (1 teaspoon d'aigéad citreach criostalaithe in aghaidh an 300 ml uisce) ag stánadh an chláir eitseáilte.

Thóg an próiseas sádrála thart ar uair an chloig, caitheadh ​​​​an chuid is mó den am sreang sádrála (stánaithe, 0.4 mm ar trastomhas) sna poill le haghaidh vias interlayer.

Nitear an bord le glantóir aerasóil FLUX OFF.
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Rinneadh dearadh an chomhlachta feiste in eagarthóir dearadh tríthoiseach ríomhchuidithe. Toisí an cháis 78,5mm X 78,5mm X 12mm .
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Sábháladh múnla críochnaithe an cháis agus an clúdach urrann ceallraí i bhformáid STL, ansin bhí sé riachtanach na samhlacha seo a ullmhú le priontáil ar printéir SLA (ag cur tacaí, treoshuíomh leis). Ag an gcéim seo, d'eascair fadhb bheag, ós rud é go bhfuil limistéar priontála printéirí SLA tí beag. Ní raibh múnla cás an fheiste sa suíomh is fearr i gcomparáid leis an am priontála oiriúnach do thoisí an limistéir priontála. Agus an múnla á chur ag 45 céim, thug sé toradh díomá freisin; bhí meáchan na tacaíochta comhionann le meáchan an mhúnla comhlacht. Socraíodh an tsamhail a phriontáil go hingearach, ag déanamh tacaíochta ar cheann de na taobhanna tosaigh, tar éis comhaontú a dhéanamh roimh ré leis an bhfíric iar-phróiseála. Ghlac sé 5 uair an chloig le priontáil a dhéanamh ar an gcorp le socrú ciseal 50 miocrón. Ansin, rinneadh an phróiseáil ag baint úsáide as páirín an-mhín (ní scríobhfaidh mé an uimhir mar níl a fhios agam :)). Thóg an clúdach ceallraí 40 nóiméad le priontáil.
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Díoltar painéil ghloine ó Aliexpress le fráma plaisteach greamaithe cheana féin; ní raibh aon fhadhbanna ann leis an bhfráma a bhaint. Bhain mé an painéal gloine tar éis é a réamhthéamh le triomadóir gruaige rialta.
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Rinneadh an diffuser don backlight LED de théip dhá thaobh le greamachán aicrileach 3M 9088-200. Maidir le soilsiú fluaraiseacha bhí roinnt ábhar le roghnú as, téip ghreamaitheach Síneach agus páipéar greamaitheach gearrtha i téipeanna ón gcuideachta baile Luminofor. Rinneadh an rogha i bhfabhar monaróir baile; de ​​réir mo mhothúcháin, bhí sé níos gile agus níos faide. Greamaíodh cearnóg páipéir le lí fluaraiseacha ar a bharr le téip dhá thaobh 3M 9088-200.

Greamaíodh an ghloine ar an gcorp lasc ag baint úsáide as téip dhá thaobh le greamachán aicrileach 3M VHB 4910.
Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Socraíodh an clúdach le scriú M 1,4 X 5 mm.

Ba é costas an fheiste ná 890 rúbal.

Ansin tháinig an chuid clár. Bhí roinnt fadhbanna ann. Tarlaíonn sé go n-oibríonn sliseanna braiteora TTP223 go hiontach le soláthar cumhachta 3.3V cobhsaithe agus nach bhfuil siad go han-mhaith nuair a bhíonn siad á gcumhachtú go díreach ó cheallraí dea-urscaoilte. Nuair a thosaigh an gléas le soláthar cumhachta timpeall 2.5v, móide tar éis “tarraingt anuas” breise nuair a bhí an cur i láthair Mysensors á oibriú amach, ba chúis leis an micreachiorcad TTP223 (díreach tar éis calabraithe) cur isteach ar an MK ó bhí sé le truicear gníomhach.

Athraíodh an ciorcad soláthair cumhachta go dtí an microcircuit (bainistiú cumhachta TTP223 le gpio MK), soláthraíodh talamh breise, agus cuireadh friotóirí le friotaíocht níos airde ar na línte rgb faoi stiúir (a ritheann ar an taobh eile den bhord braiteoir capacitive). Cuireadh leis na bogearraí é freisin: gníomhachtú cumhachta don mhicrchiorcad capacitive tar éis creat Mysensors a thosú agus an cur i láthair a oibriú amach. Tá an mhoill le haghaidh uathchalabrú an tslis TTP223 nuair a chuirtear an chumhacht i bhfeidhm faoi dhó. Chuir na hathruithe seo go léir deireadh leis an bhfadhb seo go hiomlán.

Sula mbreathnaíonn tú ar chód an chláir, molaim duit eolas a chur ar bhunstruchtúr na sceitsí i Mysensors.void before()
{
// Дополнительная функция, если сравнивать со стандартной структурой Ардуино скетчей, то before() это подобие setup(), отработка происходит до инициализации транспортного уровня Mysensors, рекомендуется например для инициализации устройств SPI
}

void setup()
{

}

void presentation()
{
//Тут происходит презентация ноды и ее сенсоров на контролере через маршрутизатор
sendSketchInfo("Name of my sensor node", "1.0"); // презентация названия ноды, версии ПО
present(CHILD_ID, S_WHATEVER, "Description"); // презентация сенсоров ноды, описания сенсоров
}

void loop()
{

}

Cód tástála an chláir lasc tadhaill:tástáil_sens.ino
/**
ТЕСТОВЫЙ СКЕТЧ СЕНСОРНОГО ВЫКЛЮЧАТЕЛЯ С ПРЕРЫВАНИЯМИ НА NRF_LPCOMP
*/
bool button_flag;
bool sens_flag;
bool send_flag;
bool detection;
bool nosleep;
byte timer;
unsigned long SLEEP_TIME = 21600000; //6 hours
unsigned long oldmillis;
unsigned long newmillis;
unsigned long interrupt_time;
unsigned long SLEEP_TIME_W;
uint16_t currentBatteryPercent;
uint16_t batteryVoltage = 0;
uint16_t battery_vcc_min = 2400;
uint16_t battery_vcc_max = 3000;

#define MY_RADIO_NRF5_ESB
//#define MY_PASSIVE_NODE
#define MY_NODE_ID 30
#define MY_PARENT_NODE_ID 0
#define MY_PARENT_NODE_IS_STATIC
#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
#define IRT_PIN 3 //(PORT0, gpio 5)
#include <MySensors.h>
// see https://www.mysensors.org/download/serial_api_20
#define SENS_CHILD_ID 0
#define CHILD_ID_VOLT 254
MyMessage sensMsg(SENS_CHILD_ID, V_VAR1);
//MyMessage voltMsg(CHILD_ID_VOLT, V_VOLTAGE);

void preHwInit() {
sleep(2000);
pinMode(RED_LED, OUTPUT);
digitalWrite(RED_LED, HIGH);
pinMode(GREEN_LED, OUTPUT);
digitalWrite(GREEN_LED, HIGH);
pinMode(BLUE_LED, OUTPUT);
digitalWrite(BLUE_LED, HIGH);
pinMode(MODE_PIN, INPUT);
pinMode(SENS_PIN, INPUT);
}

void before()
{
NRF_POWER->DCDCEN = 1;
NRF_UART0->ENABLE = 0;
sleep(1000);
digitalWrite(BLUE_LED, LOW);
sleep(150);
digitalWrite(BLUE_LED, HIGH);
}

void presentation() {
sendSketchInfo("EFEKTA Sens 1CH Sensor", "1.1");
present(SENS_CHILD_ID, S_CUSTOM, "SWITCH STATUS");
//present(CHILD_ID_VOLT, S_MULTIMETER, "Battery");
}

void setup() {
digitalWrite(BLUE_LED, LOW);
sleep(100);
digitalWrite(BLUE_LED, HIGH);
sleep(200);
digitalWrite(BLUE_LED, LOW);
sleep(100);
digitalWrite(BLUE_LED, HIGH);
lpComp();
detection = false;
SLEEP_TIME_W = SLEEP_TIME;
pinMode(31, OUTPUT);
digitalWrite(31, HIGH);
/*
while (timer < 10) {
timer++;
digitalWrite(GREEN_LED, LOW);
wait(5);
digitalWrite(GREEN_LED, HIGH);
wait(500);
}
timer = 0;
*/
sleep(7000);
while (timer < 3) {
timer++;
digitalWrite(GREEN_LED, LOW);
sleep(15);
digitalWrite(GREEN_LED, HIGH);
sleep(85);
}
timer = 0;
sleep(1000);
}

void loop() {

if (detection) {
if (digitalRead(MODE_PIN) == 1 && button_flag == 0 && digitalRead(SENS_PIN) == 0) {
//back side button detection
button_flag = 1;
nosleep = 1;
}
if (digitalRead(MODE_PIN) == 1 && button_flag == 1 && digitalRead(SENS_PIN) == 0) {
digitalWrite(RED_LED, LOW);
wait(10);
digitalWrite(RED_LED, HIGH);
wait(50);
}
if (digitalRead(MODE_PIN) == 0 && button_flag == 1 && digitalRead(SENS_PIN) == 0) {
nosleep = 0;
button_flag = 0;
digitalWrite(RED_LED, HIGH);
lpComp_reset();
}

if (digitalRead(SENS_PIN) == 1 && sens_flag == 0 && digitalRead(MODE_PIN) == 0) {
//sens detection
sens_flag = 1;
nosleep = 1;
newmillis = millis();
interrupt_time = newmillis - oldmillis;
SLEEP_TIME_W = SLEEP_TIME_W - interrupt_time;
if (send(sensMsg.set(detection))) {
send_flag = 1;
}
}
if (digitalRead(SENS_PIN) == 1 && sens_flag == 1 && digitalRead(MODE_PIN) == 0) {
if (send_flag == 1) {
while (timer < 10) {
timer++;
digitalWrite(GREEN_LED, LOW);
wait(20);
digitalWrite(GREEN_LED, HIGH);
wait(30);
}
timer = 0;
} else {
while (timer < 10) {
timer++;
digitalWrite(RED_LED, LOW);
wait(20);
digitalWrite(RED_LED, HIGH);
wait(30);
}
timer = 0;
}
}
if (digitalRead(SENS_PIN) == 0 && sens_flag == 1 && digitalRead(MODE_PIN) == 0) {
sens_flag = 0;
nosleep = 0;
send_flag = 0;
digitalWrite(GREEN_LED, HIGH);
sleep(500);
lpComp_reset();
}
if (SLEEP_TIME_W < 60000) {
SLEEP_TIME_W = SLEEP_TIME;
sendBatteryStatus();
}
}
else {
//if (detection == -1) {
SLEEP_TIME_W = SLEEP_TIME;
sendBatteryStatus();
}
if (nosleep == 0) {
oldmillis = millis();
sleep(SLEEP_TIME_W);
}
}

void sendBatteryStatus() {
wait(20);
batteryVoltage = hwCPUVoltage();
wait(2);

if (batteryVoltage > battery_vcc_max) {
currentBatteryPercent = 100;
}
else if (batteryVoltage < battery_vcc_min) {
currentBatteryPercent = 0;
} else {
currentBatteryPercent = (100 * (batteryVoltage - battery_vcc_min)) / (battery_vcc_max - battery_vcc_min);
}

sendBatteryLevel(currentBatteryPercent, 1);
wait(2000, C_INTERNAL, I_BATTERY_LEVEL);
//send(powerMsg.set(batteryVoltage), 1);
//wait(2000, 1, V_VAR1);
}

void lpComp() {
NRF_LPCOMP->PSEL = IRT_PIN;
NRF_LPCOMP->ANADETECT = 1;
NRF_LPCOMP->INTENSET = B0100;
NRF_LPCOMP->ENABLE = 1;
NRF_LPCOMP->TASKS_START = 1;
NVIC_SetPriority(LPCOMP_IRQn, 15);
NVIC_ClearPendingIRQ(LPCOMP_IRQn);
NVIC_EnableIRQ(LPCOMP_IRQn);
}

void s_lpComp() {
if ((NRF_LPCOMP->ENABLE) && (NRF_LPCOMP->EVENTS_READY)) {
NRF_LPCOMP->INTENCLR = B0100;
}
}

void r_lpComp() {
NRF_LPCOMP->INTENSET = B0100;
}

#if __CORTEX_M == 0x04
#define NRF5_RESET_EVENT(event)
event = 0;
(void)event
#else
#define NRF5_RESET_EVENT(event) event = 0
#endif

extern "C" {
void LPCOMP_IRQHandler(void) {
detection = true;
NRF5_RESET_EVENT(NRF_LPCOMP->EVENTS_UP);
NRF_LPCOMP->EVENTS_UP = 0;
MY_HW_RTC->CC[0] = (MY_HW_RTC->COUNTER + 2);
}
}

void lpComp_reset () {
s_lpComp();
detection = false;
NRF_LPCOMP->EVENTS_UP = 0;
r_lpComp();
}

MyBoardNRF5.cpp
#ifdef MYBOARDNRF5
#include <variant.h>

/*
* Pins descriptions. Attributes are ignored by arduino-nrf5 variant.
* Definition taken from Arduino Primo Core with ordered ports
*/
const PinDescription g_APinDescription[]=
{
{ NOT_A_PORT, 0, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK
{ NOT_A_PORT, 1, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // LFCLK
{ PORT0, 2, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A0, PWM4, NOT_ON_TIMER},
{ PORT0, 3, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A1, PWM5, NOT_ON_TIMER},
{ PORT0, 4, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A2, PWM6, NOT_ON_TIMER},
{ PORT0, 5, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A3, PWM7, NOT_ON_TIMER},
{ PORT0, 6, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT3
{ PORT0, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT4
{ PORT0, 8, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM10, NOT_ON_TIMER}, //USER_LED
{ PORT0, 9, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC1
{ PORT0, 10, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // NFC2
{ PORT0, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TX
{ PORT0, 12, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // RX
{ PORT0, 13, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA
{ PORT0, 14, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL
{ PORT0, 15, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SDA1
{ PORT0, 16, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // SCL1
{ PORT0, 17, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP4
{ PORT0, 18, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TP5
{ PORT0, 19, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT2
{ PORT0, 20, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1
{ PORT0, 21, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT1
{ PORT0, 22, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM9, NOT_ON_TIMER},
{ PORT0, 23, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM8, NOT_ON_TIMER},
{ PORT0, 24, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // INT
{ PORT0, 25, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //RED_LED
{ PORT0, 26, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //GREEN_LED
{ PORT0, 27, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER}, //BLUE_LED
{ PORT0, 28, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A4, PWM3, NOT_ON_TIMER},
{ PORT0, 29, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A5, PWM2, NOT_ON_TIMER},
{ PORT0, 30, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A6, PWM1, NOT_ON_TIMER},
{ PORT0, 31, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), ADC_A7, PWM0, NOT_ON_TIMER}
};

// Don't remove this line
#include <compat_pin_mapping.h>

#endif

MyBoardNRF5.h
#ifndef _MYBOARDNRF5_H_
#define _MYBOARDNRF5_H_

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

// Number of pins defined in PinDescription array
#define PINS_COUNT (32u)
#define NUM_DIGITAL_PINS (32u)
#define NUM_ANALOG_INPUTS (8u)
#define NUM_ANALOG_OUTPUTS (8u)

/*
* LEDs
*
* This is optional
*
* With My Sensors, you can use
* hwPinMode() instead of pinMode()
* hwPinMode() allows to use advanced modes like OUTPUT_H0H1 to drive LEDs.
* https://github.com/mysensors/MySensors/blob/development/drivers/NRF5/nrf5_wiring_constants.h
*
*/
#define PIN_LED1 (16)
#define PIN_LED2 (15)
#define PIN_LED3 (17)
#define RED_LED (PIN_LED1)
#define GREEN_LED (PIN_LED2)
#define BLUE_LED (PIN_LED3)
#define INTERRUPT_PIN (5)
#define MODE_PIN (25)
#define SENS_PIN (27)

/*
* Analog ports
*
* If you change g_APinDescription, replace PIN_AIN0 with
* port numbers mapped by the g_APinDescription Array.
* You can add PIN_AIN0 to the g_APinDescription Array if
* you want provide analog ports MCU independed, you can add
* PIN_AIN0..PIN_AIN7 to your custom g_APinDescription Array
* defined in MyBoardNRF5.cpp
*/
static const uint8_t A0 = ADC_A0;
static const uint8_t A1 = ADC_A1;
static const uint8_t A2 = ADC_A2;
static const uint8_t A3 = ADC_A3;
static const uint8_t A4 = ADC_A4;
static const uint8_t A5 = ADC_A5;
static const uint8_t A6 = ADC_A6;
static const uint8_t A7 = ADC_A7;

/*
* Serial interfaces
*
* RX and TX are required.
* If you have no serial port, use unused pins
* CTS and RTS are optional.
*/
#define PIN_SERIAL_RX (11)
#define PIN_SERIAL_TX (12)

#ifdef __cplusplus
}
#endif

#endif

Tá cnaipe tadhaill agus cnaipe tact ar chúl an ghléis ar an lasc. Úsáidfear an cnaipe tact seo le haghaidh modhanna seirbhíse, modh ceangailteach thar an aer, agus athshocrú gléas. Tá gné frith-preab iarainn ag an gcnaipe. Tá líne an braiteora capacitive agus líne an cnaipe tact ceangailte trí dé-óid Schottky agus ceangailte leis an bioráin analógach p0.05, agus freisin ón braiteoir capacitive agus an cnaipe tact tá línte chuig na bioráin MK p0.25 agus p0.27 .0.05 maidir le staideanna a léamh tar éis an t-idirbhriseadh a ghníomhachtú ar bioráin lch. 0.05. Ar bhioráin pXNUMX, cuirtear idirbhriseadh tríd an gcomparadóir (NRF_LPCOMP) trí EVENTS_UP i ngníomh. Fuair ​​​​mé inspioráid chun an fhadhb a réiteach anseo и anseo.

Cuireadh an lasc leis an líonra Mysensors, arna bhainistiú ag an rialtóir baile cliste Majordomo (sayt proekta)

Cód PHP chun lasc a chur leis an modh statusUpdate

if (getGlobal("MysensorsButton01.status")==1) {
if (getGlobal('MysensorsRelay04.status') == 0) {
setGlobal('MysensorsRelay04.status', '1');
} else if (getGlobal('MysensorsRelay04.status') == 1) {
setGlobal('MysensorsRelay04.status', '0');
} 
}

Féach ar an toradh san fhíseán

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Níos déanaí, rinneadh rogha le tiontaire treisithe, ach níl baint aige seo le hoibriú an microcircuit capacitive TTP223; tá níos mó dúil le haghaidh soilsiú maith agus aonfhoirmeach nuair a bhíonn na heochracha á bhrú ar feadh shaolré iomlán na ceallraí.

AmharcLasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Tionscadal Github - github.com/smartboxchannel/EFEKTA_WIRELESS_TOUCH_SWITCH

Rúisis ag labhairt suíomh pobail Misinéirí

Telegram comhrá Mysensors — réiteach tapa ar fhadhbanna le Mysensors, leideanna, cleasanna, cláir a shuiteáil, oibriú le micrea-rialaitheoirí atmega 328, stm32, nRF5 san Arduino IDE - @mysensors_rus

Roinnt grianghrafLasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Lasc tadhaill gan sreang le backlight fluaraiseacha breise

Foinse: will.com

Add a comment