当前位置:网站首页>Pi4j pin analog bus, several ideas of control transmission and data transmission
Pi4j pin analog bus, several ideas of control transmission and data transmission
2022-06-21 22:20:00 【Water ice stone】
We know Java Language can delay in milliseconds , Such as :Thread.sleep(1), But when we need a serial port line for control transmission , When data is transmitted , Microsecond level delay is required , How can this be controlled ?
java The language itself api Corresponding functions are not provided . as a result of jvm The instruction set of cannot be controlled to the microsecond level ?
pi4j The bottom layer used is wiringPi, that wiringPi Can pass microTime Gets the current number of milliseconds , But by looking at api, Encapsulated... Not found microTime Methods , Therefore, the corresponding microsecond delay function cannot be found directly .
What should I do if I can't find it ?
1. Encapsulate the interface functions by yourself . But because of jvm The instruction execution of the virtual machine itself will take a certain clock cycle , At the clock speed of raspberry pie , Basically these jvm Level instructions will cause inaccurate delay in microseconds .
2. Encapsulate complete business functions into wiringPi, Bind deferred functions and business logic to non - java On the underlying code , Extend business functions to the underlying code . Use it like this Java Language encapsulates a closed-loop business scenario , To achieve microsecond level business layer control .
3. Use it directly c Language or low-level language , Write business logic , use Java Language call
in any case , such gpio Of i/o Pin as bus ( for example DHT11 Temperature and humidity sensor data reading ), Can't be used directly Java To control microsecond delay . The only thing we can do is to bypass java Delay microsecond level function , Instead, it puts functionality on the underlying language , Form a business closed loop , Reuse java Encapsulate a complete business scenario , Provide overall business functions externally . This compromise can solve the problem of data reading . But it depends on the underlying language , for example c Language learning .
边栏推荐
- TRNA analysis using trnascan se
- 力扣:零钱兑换
- Instadeep ltd:arthur flajolet | group based rapid reinforcement learning on a single machine
- Shanghai Xiangwei electromechanical Co., Ltd., a state-owned enterprise, has reached strategic cooperation with China and foreign countries and donated 200million yuan
- Characteristics and experimental suggestions of abbkine cell cycle Staining Kit
- cpu指令重排导致错误的一个例子
- 洛谷P1535 [USACO08MAR]Cow Travelling S 题解
- 利用tRNAscan-SE做tRNA分析
- 高项-立项管理
- Worthington trypsin solution
猜你喜欢

I2C【2】-IIC为什么需要用开漏输出和上拉电阻bug

利用tRNAscan-SE做tRNA分析

从-1开始实现一个中间件

迅为iTOP-3568开发板安装 RKNN Toolkit Lite2

提升方法(上)AdaBoost
![[deeply understand tcapulusdb technology] one click installation of tmonitor background](/img/33/7d390732d6e441a4311189b6e49474.png)
[deeply understand tcapulusdb technology] one click installation of tmonitor background

浅学Vector---如何使用常见的接口

【深入理解TcaplusDB技术】 Tmonitor模块架构

Leetcode question brushing: SF Technology Smart logistics Campus Technology Challenge

Sampler collection
随机推荐
安超云入选《CIOReview》2022年亚太区“十大云计算解决方案提供商”
弗吉尼亚大学:Ingy ElSayed-Aly | 多智能体强化学习中的基于逻辑的奖励形成
Mafft|multi sequence alignment tool
【深入理解TcaplusDB技术】如何实现Tmonitor单机安装
An example of CPU instruction rearrangement leading to errors
刷题笔记(十七)--二叉搜索树:关于属性问题
How to write the title of popular popular items in our media video
【深入理解TcaplusDB技术】TcaplusDB构造数据
联系五心红娘脱单
C#的DataGridView中字体大小
利用BioEdit做多序列一致性比对
提升方法(下)提升树
【深入理解TcaplusDB技术】一键安装Tmonitor后台
Shell script simple syntax
Shanghai Xiangwei electromechanical Co., Ltd., a state-owned enterprise, has reached strategic cooperation with China and foreign countries and donated 200million yuan
Ruiji housekeeper, a century old classic, is waiting for your elegant journey to start again
精彩回顾丨一图了解华为云专场干货
Using bioedit to do multiple sequence consistency alignment
001 new construction project based on opencvsharp
Notes on topic brushing (16) -- binary tree: modification and construction