日B视频 亚洲,啪啪啪网站一区二区,91色情精品久久,日日噜狠狠色综合久,超碰人妻少妇97在线,999青青视频,亚洲一区二卡,让本一区二区视频,日韩网站推荐

電子發(fā)燒友App

硬聲App

掃碼添加小助手

加入工程師交流群

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>NanoframeWork和NRF24L01及ESP32開源

NanoframeWork和NRF24L01及ESP32開源

2023-02-07 | zip | 1.01 MB | 次下載 | 2積分

資料介紹

描述

嗨朋友:)

我想與您分享另一個 Nanoframework 項目。

讓我們從換向裝置開始吧!

今天,換向是一個非常重要的概念。

我們有許多設備和協(xié)議可以與其他事物通信,例如藍牙Wi-Fi 或有線……。

當我們想要控制遠程汽車或電燈或……時,特別是在物聯(lián)網(wǎng)項目中,通信非常重要。

?

untitled-2_EnsQyZ320q.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

我之前使用過 esp32 Wi-Fi 和簡單的電線。

所以我決定使用名為 NRF24L01_PA_LNA 的新模塊

NRF24L01_PA_LNA 是與 SPI 配合使用的無線模塊

?

nrf24l01palna-module_wzpNGtj1rh.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
?

我準備了一個基礎納米框架庫來控制 NRF24L01_PA_LNA。(AP.NanoFrameWork.NRF24L01PALNA)

實際上,我正在研究它,我將繼續(xù)為 Nanoframework 開發(fā)這個庫。

好的,讓我們通過示例項目向您展示我的庫用法:

首先,我們需要兩個“esp32 wroom32”開發(fā)套件。(我有一個開發(fā)套件 v1 和開發(fā)套件 v4)

?

esp-32-development-board-wifi-bluetooth-ultra-low-power-500x500_rvZJWD65rP.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

?

esp32-devkitc-v4-pinout_YHF6sRc5Xn.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
?

我們需要兩個 NRF24L01_PA_LNA 模塊

第一步:將 NRF24L01_PA_LNA 連接到 esp32 開發(fā)套件。

接地到接地

VCC 到 VCC 3.3

IRQ 到 GPIO 17

CE 到 GPIO 16

MOSI 到 MOSI(GPIO 23 或 GPIO 13 ??)

MISO 到 MISO(GPIO 19 或 GPIO 12 ??)

SS 到 SS(GPIO 15 或 GPIO 5 ??)

?

pinout-nrf24l01-pa-lna-external-antenna-wireless-transceiver-module_SRt3RGLYgj.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

當我們查看 esp32 引腳時,我們發(fā)現(xiàn)它有 2 個 SPI 接口(VSPI、HSPI),這里的問題是哪個接口必須連接到 NRF24L01_PA_LNA ??!!!

?

esp32-devkitc-v4-pinout22222_vM8xBf5xeS.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
?

為了找到答案,讓我們來看看 Nanoframework spi 示例

納米框架 Git

?

c1_qx5r1KXKRA.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

嗯,對于這個示例,我無法理解執(zhí)行哪個接口 Nanoframework spi 庫?!

經(jīng)過大量研發(fā),我找到了它;Nanoframework SPI 庫與 SPI1 配合使用。因此,我們需要為 SPI1 設置 PinFunction。

我用的是VSPI。所以,我應該像這樣設置 PinFunction:

?

screenshot_2022-02-22_193843_znsRuGJMmf.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

?

c2_IVkKGkmhc9.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

現(xiàn)在,我們應該用這個參數(shù)初始化 SPI:

?

c3_8bMA6SxcXl.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

注:該參數(shù)根據(jù)NRF24L01PALNA文檔進行初始化

然后,使用 AP.NanoFrameWork.NRF24L01PALNA,我們可以輕松地發(fā)送和接收數(shù)據(jù):

最初的:

?

c4_DfResyyF22.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

注意:您可以在發(fā)送方和接收方上設置 PA 和數(shù)據(jù)速率

發(fā)件人:

初始交易

?

c5_J3VFc25Es6.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

或者

?

c6_MI8Tfzt7YX.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

發(fā)送數(shù)據(jù)

?

c7_8HqhwC80Eo.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

收到:

初始接收

?

c8_Leybqz8eiu.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

開始接收

?

c9_r18qQJekel.png?auto=compress%2Cformat&w=740&h=555&fit=max
?

有些參數(shù)在我的庫中是硬編碼的,但我會開發(fā)它并使其更靈活

?

whatsapp_image_2022-02-21_at_10_29_17_pm_jErWlP36zv.jpeg?auto=compress%2Cformat&w=740&h=555&fit=max
?

?

whatsapp_image_2022-02-21_at_10_29_16_pm_HMsej0dRdg.jpeg?auto=compress%2Cformat&w=740&h=555&fit=max
?

?

?

發(fā)送

var gpioController = new GpioController();


            var p1 = Configuration.GetFunctionPin(DeviceFunction.SPI1_CLOCK);

            if (p1 != 18)
            {

                Configuration.SetPinFunction(18, DeviceFunction.SPI1_CLOCK);
                Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO);
                Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI);

            }

            var irq = gpioController.OpenPin(17);
            irq.SetPinMode(PinMode.InputPullUp);
            irq.ValueChanged += Irq_ValueChanged;

            var ce = gpioController.OpenPin(16);
            ce.SetPinMode(PinMode.Output);

            var csn = gpioController.OpenPin(5, PinMode.Output);


            Thread.Sleep(200);


            SpiDevice spiDevice;
            SpiConnectionSettings connectionSettings;


            SpiBusInfo spiBusInfo = SpiDevice.GetBusInfo(1);
            Debug.WriteLine($"{nameof(spiBusInfo.ChipSelectLineCount)}: {spiBusInfo.ChipSelectLineCount}");
            Debug.WriteLine($"{nameof(spiBusInfo.MaxClockFrequency)}: {spiBusInfo.MaxClockFrequency}");
            Debug.WriteLine($"{nameof(spiBusInfo.MinClockFrequency)}: {spiBusInfo.MinClockFrequency}");
            Debug.WriteLine($"{nameof(spiBusInfo.SupportedDataBitLengths)}: ");

            foreach (var data in spiBusInfo.SupportedDataBitLengths)
            {
                Debug.WriteLine($"  {data}");
            }

         
            connectionSettings = new SpiConnectionSettings(1, -1);
            connectionSettings.ClockFrequency = 4_000_000;
            connectionSettings.DataBitLength = 8;
            connectionSettings.DataFlow = DataFlow.MsbFirst;
            connectionSettings.Mode = SpiMode.Mode0;


            // Then you create your SPI device by passing your settings
            spiDevice = SpiDevice.Create(connectionSettings);


            Thread.Sleep(50);


            NRFActions nrf24 = new NRFActions(spiDevice, csn, ce);



            ////Read Status
            ////..................


            nrf24.InitialTXMode(NRFActions.PAState.Min, NRFActions.DataRate.d1Mbps);


            Thread.Sleep(100);


            while (true)
            {
                nrf24.SendData("Hi My Name Is Alireza Paridar.)");
                Thread.Sleep(1000);
            }

?

接收:

var gpioController = new GpioController();


            var irq = gpioController.OpenPin(17);
            irq.SetPinMode(PinMode.InputPullUp);
            irq.ValueChanged += Irq_ValueChanged;

            var p1 = Configuration.GetFunctionPin(DeviceFunction.SPI1_CLOCK);

            if (p1 != 18)
            {

                Configuration.SetPinFunction(18, DeviceFunction.SPI1_CLOCK);
                Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO);
                Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI);


            }
      


            var ce = gpioController.OpenPin(16);
            ce.SetPinMode(PinMode.Output);




            // var csn = gpioController.OpenPin(15, PinMode.Output);
            var csn = gpioController.OpenPin(5, PinMode.Output);
     

            Thread.Sleep(200);


            SpiDevice spiDevice;
            SpiConnectionSettings connectionSettings;
            Debug.WriteLine("Hello from sample for System.Device.Spi!");
            // You can get the values of SpiBus
            SpiBusInfo spiBusInfo = SpiDevice.GetBusInfo(1);
            Debug.WriteLine($"{nameof(spiBusInfo.ChipSelectLineCount)}: {spiBusInfo.ChipSelectLineCount}");
            Debug.WriteLine($"{nameof(spiBusInfo.MaxClockFrequency)}: {spiBusInfo.MaxClockFrequency}");
            Debug.WriteLine($"{nameof(spiBusInfo.MinClockFrequency)}: {spiBusInfo.MinClockFrequency}");
            Debug.WriteLine($"{nameof(spiBusInfo.SupportedDataBitLengths)}: ");
            foreach (var data in spiBusInfo.SupportedDataBitLengths)
            {
                Debug.WriteLine($"  {data}");
            }

            connectionSettings = new SpiConnectionSettings(1, -1);


            connectionSettings.ClockFrequency = 4_000_000;//96000;//10_000_000;
            connectionSettings.DataBitLength = 8;
            connectionSettings.DataFlow = DataFlow.MsbFirst;
            connectionSettings.Mode = SpiMode.Mode0;



            // Then you create your SPI device by passing your settings
            spiDevice = SpiDevice.Create(connectionSettings);

            Thread.Sleep(50);


            NRFActions nrf24 = new NRFActions(spiDevice, csn, ce);

    

            nrf24.InitialRXMode(NRFActions.PAState.Min, NRFActions.DataRate.d1Mbps);


            while (true)
            {
                Thread.Sleep(1000);

                var buf = nrf24.ReciveData();

                if(buf==null || buf.Length <= 0)
                {
                    continue;
                }

                string res = "";
                for (int i = 0; i < buf.Length; i++)
                {
                    res += $"{buf[i].ToString()},";
                }

                Debug.WriteLine(res);
                Debug.WriteLine("");

                string txt = System.Text.Encoding.UTF8.GetString(buf, 0, buf.Length);
                Debug.WriteLine(txt);
                Debug.WriteLine("------------------");

            }

我有很多想法可以用這個模塊創(chuàng)建很多項目,我正在努力。完成后我會分享結(jié)果。

如果你愿意,可以在 GitHub 上加入我來開發(fā)這個庫。

我的 GitHub (github.com/AlirezaP)

AlirezaP/AP.NanoFrameWork.NRF24L01PALNA (github.com)

NanoFrameWork 使處理硬件變得容易。忘記低級 c 或 c++ 代碼,只關注想法;)


nRF24L01 ESP32
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1矽力杰 Silergy SY7215A 同步升壓調(diào)節(jié)器 規(guī)格書 Datasheet 佰祥電子
  2. 1.12 MB  |  5次下載  |  免費
  3. 2HT81696H 內(nèi)置升壓的30W立體聲D類音頻功放數(shù)據(jù)手冊
  4. 1.21 MB   |  1次下載  |  免費
  5. 3HTA6863 3W超低噪聲超低功耗單聲道D類音頻功率放大器數(shù)據(jù)手冊
  6. 0.87 MB   |  次下載  |  免費
  7. 4南芯 Southchip SC8802C 充電控制器 規(guī)格書 Datasheet 佰祥電子
  8. 88.16 KB  |  次下載  |  免費
  9. 5矽力杰 Silergy SY7065 同步升壓轉(zhuǎn)換器 規(guī)格書 Datasheet 佰祥電子
  10. 910.67 KB  |  次下載  |  免費
  11. 6矽力杰 Silergy SY7066 同步升壓轉(zhuǎn)換器 規(guī)格書 Datasheet 佰祥電子
  12. 989.14 KB  |  次下載  |  免費
  13. 7WD6208A產(chǎn)品規(guī)格書
  14. 631.24 KB  |  次下載  |  免費
  15. 8NB685 26 V,12 A,低靜態(tài)電流,大電流 同步降壓變換器數(shù)據(jù)手冊
  16. 1.64 MB   |  次下載  |  2 積分

本月

  1. 1EMC PCB設計總結(jié)
  2. 0.33 MB   |  12次下載  |  免費
  3. 2PD取電芯片 ECP5702規(guī)格書
  4. 0.88 MB   |  5次下載  |  免費
  5. 3矽力杰 Silergy SY7215A 同步升壓調(diào)節(jié)器 規(guī)格書 Datasheet 佰祥電子
  6. 1.12 MB  |  5次下載  |  免費
  7. 4氮化鎵GaN FET/GaN HEMT 功率驅(qū)動電路選型表
  8. 0.10 MB   |  3次下載  |  免費
  9. 5PD取電芯片,可取5/9/12/15/20V電壓ECP5702數(shù)據(jù)手冊
  10. 0.88 MB   |  3次下載  |  免費
  11. 6SY50655 用于高輸入電壓應用的偽固定頻率SSR反激式穩(wěn)壓器英文資料
  12. 1.01 MB   |  3次下載  |  免費
  13. 7怎么為半導體測試儀選擇精密放大器
  14. 0.65 MB   |  2次下載  |  免費
  15. 8SY52341 次級側(cè)同步整流英文手冊
  16. 0.94 MB   |  2次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935137次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設計
  4. 1.48MB  |  420064次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233095次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費下載
  8. 340992  |  191469次下載  |  10 積分
  9. 5十天學會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183360次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81606次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73832次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65991次下載  |  10 積分
独山县| 红桥区| 孝义市| 双流县| 胶南市| 聂荣县| 高尔夫| 巧家县| 长春市| 汾西县| 东莞市| 房产| 嵊州市| 瑞昌市| 靖西县| 乐至县| 黄石市| 留坝县| 剑川县| 资溪县| 谷城县| 武威市| 濉溪县| 台南县| 四会市| 双城市| 措勤县| 孝义市| 会宁县| 保德县| 虞城县| 大方县| 兴和县| 鱼台县| 卫辉市| 儋州市| 赣榆县| 二连浩特市| 西华县| 银川市| 利津县|