{"id":445847,"date":"2025-01-22T21:04:32","date_gmt":"2025-01-22T21:04:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=445847"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=445847","title":{"rendered":"<span>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 NRF24L01 \u0438 STM32F1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>NRF24L01<\/strong> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441\u043e <strong>STM32F1<\/strong>. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0432 Arduino IDE. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043a\u043e\u0434 \u0438 \u0441\u0445\u0435\u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0430\u043c\u043e\u043c\u0443.<\/p>\n<h2>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/h2>\n<p>\u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441 Arduino UNO \u043d\u0430 stm32f1 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 NRF24L01. \u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u0430 \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0443\u0448\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0432\u044f\u0437\u043a\u043e\u0439 stm32f1 + NRF24L01.<\/p>\n<h2>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h2>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0432 <strong>Arduino IDE<\/strong>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0442\u043e <a href=\"https:\/\/microsin.net\/programming\/arm\/how-to-program-a-stm32-blue-pill-with-arduino.html\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p><strong>\u0412\u0410\u0416\u041d\u041e! \u0415\u0421\u041b\u0418 \u0412\u042b \u0412\u042b\u0411\u0420\u0410\u041b\u0418 \u0414\u0420\u0423\u0413\u041e\u0415 \u042f\u0414\u0420\u041e, \u042d\u0422\u041e \u041c\u041e\u0416\u0415\u0422 \u041f\u0420\u0418\u0412\u0415\u0421\u0422\u0418 \u041a \u041d\u0415\u0418\u0417\u0412\u0415\u0421\u0422\u041d\u042b\u041c \u041f\u041e\u0421\u041b\u0415\u0414\u0421\u0422\u0412\u0418\u042f\u041c.  <\/strong>\u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u043f\u043e\u043b\u0435 &#171;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u043b\u0430\u0442&#187; \u044f \u0432\u043f\u0438\u0441\u0430\u043b: <a href=\"https:\/\/github.com\/stm32duino\/BoardManagerFiles\/raw\/main\/package_stmicroelectronics_index.json\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/stm32duino\/BoardManagerFiles\/raw\/main\/package_stmicroelectronics_index.json<\/a> <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>RF24<\/strong>. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c NRF24L01 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f. \u0418\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0430 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u043a \u0441\u0438\u043b\u0435 \u0442\u043e\u043a\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0435\u0451 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043d\u0430\u0448\u0451\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 instructables. \u041a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u043e\u0442\u0442\u0443\u0434\u0430, \u043d\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0446\u0435\u043f\u044c \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f NRF24L01 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0434\u0435\u043d\u0441\u0430\u0442\u043e\u0440 \u0451\u043c\u043a\u043e\u0441\u0442\u044c\u044e 10 \u043c\u043a\u0424.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430.<\/p>\n<h2>\u0420\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0430 NRF24L01<\/h2>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"50\" width=\"50\">\n<p>Pin<\/p>\n<\/th>\n<th data-colwidth=\"68\" width=\"68\">\n<p>Name<\/p>\n<\/th>\n<th>\n<p>Description<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">GND<\/p>\n<\/td>\n<td>\n<p align=\"left\">Ground (0V)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">VCC<\/p>\n<\/td>\n<td>\n<p align=\"left\">Power Supply (3.3V)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">CE<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mode Enable Activates RX or TX mode<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">CSN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Chip Select<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">SCK<\/p>\n<\/td>\n<td>\n<p align=\"left\">Serial Clock<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">MOSI<\/p>\n<\/td>\n<td>\n<p align=\"left\">Master Output, Slave Input<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">MISO<\/p>\n<\/td>\n<td>\n<p align=\"left\">Master Input, Slave Output<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">IRQ<\/p>\n<\/td>\n<td>\n<p align=\"left\">Interrupt Request. Under wireless communication, MCU communicates with NRF24L01 by IRQ.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2db\/39b\/909\/2db39b90903d2a7950563d0226e579fb.png\" alt=\"\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430 sunfounder\" title=\"\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430 sunfounder\" width=\"600\" height=\"378\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2db\/39b\/909\/2db39b90903d2a7950563d0226e579fb.png\"\/><\/p>\n<div><figcaption>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino\" rel=\"noopener noreferrer nofollow\">sunfounder<\/a><\/figcaption><\/div>\n<\/figure>\n<h2>\u0420\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0430 STM32F1<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d78\/b5b\/f7b\/d78b5bf7bbbbbafa0494375c07c17435.png\" alt=\"\" title=\"\" width=\"1024\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d78\/b5b\/f7b\/d78b5bf7bbbbbafa0494375c07c17435.png\"\/><\/figure>\n<h2>\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 STM32F1 \u0441 NRF24L01<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/366\/210\/54f\/36621054fea6070f0bc62fe76eb42c10.png\" alt=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430\" title=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430\" width=\"858\" height=\"622\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/366\/210\/54f\/36621054fea6070f0bc62fe76eb42c10.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/acc\/f52\/d44\/accf52d44456050962bd8bf97ed1282c.png\" alt=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\" title=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\" width=\"853\" height=\"490\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acc\/f52\/d44\/accf52d44456050962bd8bf97ed1282c.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/h2>\n<pre><code class=\"cpp\">#include &lt;SPI.h&gt; #include &lt;nRF24L01.h&gt; #include &lt;RF24.h&gt;  #define CE_PIN PB0 #define CSN_PIN PA4  #define RED_PIN PB10 #define GREEN_PIN PB11  #define CLOSE_BTN_PIN PB6 #define OPEN_BTN_PIN PB7  RF24 radio(CE_PIN, CSN_PIN);  const uint64_t address = 0xF0F0F0F0E1LL; boolean button_1_state = 0; boolean button_2_state = 0;   void setup() {   \/\/ \u041a\u043d\u043e\u043f\u043a\u0438   pinMode(CLOSE_BTN_PIN, INPUT_PULLUP);   pinMode(OPEN_BTN_PIN, INPUT_PULLUP);    \/\/ \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b   pinMode(RED_PIN, OUTPUT);   pinMode(GREEN_PIN, OUTPUT);    digitalWrite(RED_PIN, HIGH);   digitalWrite(GREEN_PIN, HIGH);    Serial.begin(9600);    radio.begin();   radio.openWritingPipe(address);   radio.setPALevel(RF24_PA_MIN);   radio.stopListening();      digitalWrite(RED_PIN, LOW);   digitalWrite(GREEN_PIN, LOW); }  void loop() {   button_1_state = digitalRead(CLOSE_BTN_PIN);   button_2_state = digitalRead(OPEN_BTN_PIN);    while(!button_1_state &amp;&amp; button_2_state) {     char text[2];     text[0] = 0xAA;     text[1] = 0x00;     radio.write(&amp;text, sizeof(text));     digitalWrite(GREEN_PIN, HIGH);          button_1_state = digitalRead(CLOSE_BTN_PIN);     button_2_state = digitalRead(OPEN_BTN_PIN);   }   digitalWrite(GREEN_PIN, LOW);      while(button_1_state &amp;&amp; !button_2_state) {     char text[2];     text[0] = 0xAC;     text[1] = 0x00;     radio.write(&amp;text, sizeof(text));     digitalWrite(RED_PIN, HIGH);      button_1_state = digitalRead(CLOSE_BTN_PIN);     button_2_state = digitalRead(OPEN_BTN_PIN);   }   digitalWrite(RED_PIN, LOW);      delay(100); } <\/code><\/pre>\n<h2>\u041a\u043e\u0434 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430<\/h2>\n<pre><code class=\"cpp\">#include &lt;SPI.h&gt; #include &lt;nRF24L01.h&gt; #include &lt;RF24.h&gt; #include &lt;SoftwareSerial.h&gt;  #define TX_PIN PA9 #define RX_PIN PA10  #define CE_PIN PB0 #define CSN_PIN PA4  #define RELAY_PIN PB3   SoftwareSerial mySerial(RX_PIN, TX_PIN); RF24 radio(CE_PIN, CSN_PIN);  const uint64_t address = 0xF0F0F0F0E1LL;   void setup() {   pinMode(RELAY_PIN, OUTPUT);   digitalWrite(RELAY_PIN, LOW);    mySerial.begin(9600);   radio.begin();   radio.openReadingPipe(0, address);   radio.setPALevel(RF24_PA_MIN);   radio.startListening(); }  void loop() {   if (radio.available())   {     char text[2] = \"\";     radio.read(&amp;text, sizeof(text));      if (text[0] == 0xAA) {       mySerial.println(text);       digitalWrite(RELAY_PIN, HIGH);     }      else if(text[0] == 0xAC) {       mySerial.println(text);       digitalWrite(RELAY_PIN, LOW);     }   }   delay(5); } <\/code><\/pre>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<ol>\n<li>\n<p><a href=\"http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino\" rel=\"noopener noreferrer nofollow\">http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.instructables.com\/NRF24L01-on-STM32F103\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.instructables.com\/NRF24L01-on-STM32F103\/<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/875638\/\"> https:\/\/habr.com\/ru\/articles\/875638\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>NRF24L01<\/strong> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441\u043e <strong>STM32F1<\/strong>. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0432 Arduino IDE. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043a\u043e\u0434 \u0438 \u0441\u0445\u0435\u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0430\u043c\u043e\u043c\u0443.<\/p>\n<h2>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/h2>\n<p>\u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441 Arduino UNO \u043d\u0430 stm32f1 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 NRF24L01. \u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u0430 \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0443\u0448\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0432\u044f\u0437\u043a\u043e\u0439 stm32f1 + NRF24L01.<\/p>\n<h2>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h2>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0432 <strong>Arduino IDE<\/strong>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0442\u043e <a href=\"https:\/\/microsin.net\/programming\/arm\/how-to-program-a-stm32-blue-pill-with-arduino.html\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p><strong>\u0412\u0410\u0416\u041d\u041e! \u0415\u0421\u041b\u0418 \u0412\u042b \u0412\u042b\u0411\u0420\u0410\u041b\u0418 \u0414\u0420\u0423\u0413\u041e\u0415 \u042f\u0414\u0420\u041e, \u042d\u0422\u041e \u041c\u041e\u0416\u0415\u0422 \u041f\u0420\u0418\u0412\u0415\u0421\u0422\u0418 \u041a \u041d\u0415\u0418\u0417\u0412\u0415\u0421\u0422\u041d\u042b\u041c \u041f\u041e\u0421\u041b\u0415\u0414\u0421\u0422\u0412\u0418\u042f\u041c.  <\/strong>\u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u043f\u043e\u043b\u0435 &#171;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u043b\u0430\u0442&#187; \u044f \u0432\u043f\u0438\u0441\u0430\u043b: <a href=\"https:\/\/github.com\/stm32duino\/BoardManagerFiles\/raw\/main\/package_stmicroelectronics_index.json\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/stm32duino\/BoardManagerFiles\/raw\/main\/package_stmicroelectronics_index.json<\/a> <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>RF24<\/strong>. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c NRF24L01 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f. \u0418\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0430 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u043a \u0441\u0438\u043b\u0435 \u0442\u043e\u043a\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0435\u0451 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043d\u0430\u0448\u0451\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 instructables. \u041a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u043e\u0442\u0442\u0443\u0434\u0430, \u043d\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0446\u0435\u043f\u044c \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f NRF24L01 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0434\u0435\u043d\u0441\u0430\u0442\u043e\u0440 \u0451\u043c\u043a\u043e\u0441\u0442\u044c\u044e 10 \u043c\u043a\u0424.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430.<\/p>\n<h2>\u0420\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0430 NRF24L01<\/h2>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"50\" width=\"50\">\n<p>Pin<\/p>\n<\/th>\n<th data-colwidth=\"68\" width=\"68\">\n<p>Name<\/p>\n<\/th>\n<th>\n<p>Description<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">GND<\/p>\n<\/td>\n<td>\n<p align=\"left\">Ground (0V)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">VCC<\/p>\n<\/td>\n<td>\n<p align=\"left\">Power Supply (3.3V)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">CE<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mode Enable Activates RX or TX mode<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">CSN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Chip Select<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">SCK<\/p>\n<\/td>\n<td>\n<p align=\"left\">Serial Clock<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">MOSI<\/p>\n<\/td>\n<td>\n<p align=\"left\">Master Output, Slave Input<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">MISO<\/p>\n<\/td>\n<td>\n<p align=\"left\">Master Input, Slave Output<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"68\" width=\"68\">\n<p align=\"left\">IRQ<\/p>\n<\/td>\n<td>\n<p align=\"left\">Interrupt Request. Under wireless communication, MCU communicates with NRF24L01 by IRQ.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<figure class=\"full-width\">\n<div><figcaption>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino\" rel=\"noopener noreferrer nofollow\">sunfounder<\/a><\/figcaption><\/div>\n<\/figure>\n<h2>\u0420\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0430 STM32F1<\/h2>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 STM32F1 \u0441 NRF24L01<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/h2>\n<pre><code class=\"cpp\">#include &lt;SPI.h&gt; #include &lt;nRF24L01.h&gt; #include &lt;RF24.h&gt;  #define CE_PIN PB0 #define CSN_PIN PA4  #define RED_PIN PB10 #define GREEN_PIN PB11  #define CLOSE_BTN_PIN PB6 #define OPEN_BTN_PIN PB7  RF24 radio(CE_PIN, CSN_PIN);  const uint64_t address = 0xF0F0F0F0E1LL; boolean button_1_state = 0; boolean button_2_state = 0;   void setup() {   \/\/ \u041a\u043d\u043e\u043f\u043a\u0438   pinMode(CLOSE_BTN_PIN, INPUT_PULLUP);   pinMode(OPEN_BTN_PIN, INPUT_PULLUP);    \/\/ \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b   pinMode(RED_PIN, OUTPUT);   pinMode(GREEN_PIN, OUTPUT);    digitalWrite(RED_PIN, HIGH);   digitalWrite(GREEN_PIN, HIGH);    Serial.begin(9600);    radio.begin();   radio.openWritingPipe(address);   radio.setPALevel(RF24_PA_MIN);   radio.stopListening();      digitalWrite(RED_PIN, LOW);   digitalWrite(GREEN_PIN, LOW); }  void loop() {   button_1_state = digitalRead(CLOSE_BTN_PIN);   button_2_state = digitalRead(OPEN_BTN_PIN);    while(!button_1_state &amp;&amp; button_2_state) {     char text[2];     text[0] = 0xAA;     text[1] = 0x00;     radio.write(&amp;text, sizeof(text));     digitalWrite(GREEN_PIN, HIGH);          button_1_state = digitalRead(CLOSE_BTN_PIN);     button_2_state = digitalRead(OPEN_BTN_PIN);   }   digitalWrite(GREEN_PIN, LOW);      while(button_1_state &amp;&amp; !button_2_state) {     char text[2];     text[0] = 0xAC;     text[1] = 0x00;     radio.write(&amp;text, sizeof(text));     digitalWrite(RED_PIN, HIGH);      button_1_state = digitalRead(CLOSE_BTN_PIN);     button_2_state = digitalRead(OPEN_BTN_PIN);   }   digitalWrite(RED_PIN, LOW);      delay(100); } <\/code><\/pre>\n<h2>\u041a\u043e\u0434 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430<\/h2>\n<pre><code class=\"cpp\">#include &lt;SPI.h&gt; #include &lt;nRF24L01.h&gt; #include &lt;RF24.h&gt; #include &lt;SoftwareSerial.h&gt;  #define TX_PIN PA9 #define RX_PIN PA10  #define CE_PIN PB0 #define CSN_PIN PA4  #define RELAY_PIN PB3   SoftwareSerial mySerial(RX_PIN, TX_PIN); RF24 radio(CE_PIN, CSN_PIN);  const uint64_t address = 0xF0F0F0F0E1LL;   void setup() {   pinMode(RELAY_PIN, OUTPUT);   digitalWrite(RELAY_PIN, LOW);    mySerial.begin(9600);   radio.begin();   radio.openReadingPipe(0, address);   radio.setPALevel(RF24_PA_MIN);   radio.startListening(); }  void loop() {   if (radio.available())   {     char text[2] = \"\";     radio.read(&amp;text, sizeof(text));      if (text[0] == 0xAA) {       mySerial.println(text);       digitalWrite(RELAY_PIN, HIGH);     }      else if(text[0] == 0xAC) {       mySerial.println(text);       digitalWrite(RELAY_PIN, LOW);     }   }   delay(5); } <\/code><\/pre>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<ol>\n<li>\n<p><a href=\"http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino\" rel=\"noopener noreferrer nofollow\">http:\/\/wiki.sunfounder.cc\/index.php?title=NRF24L01_Test_with_Arduino<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.instructables.com\/NRF24L01-on-STM32F103\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.instructables.com\/NRF24L01-on-STM32F103\/<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/875638\/\"> https:\/\/habr.com\/ru\/articles\/875638\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-445847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445847"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445847\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}