Arduino光控LED

光敏电阻光明电阻的阻值会随光照强度发生变化,射入的光强,电阻减小,射入的光弱,电阻增大。 经过测量在室内光照情况下,它的阻值大约为3K,挡住光线的时候阻值大约为20K,完全挡住,阻值变为无穷大。 因此我们可以用一个电阻与它串联,做一个分压电路,使用模拟端口读入电压值,进行其他电路的控制。接线图如下 代码如下, int photocellPin = 2; //定义变量photocellsh=2,为电压读取端口。 int ledPin = 12; //定义变量ledPin=12,为led电平输出端口 int val = 0; //定义val变量的起始值 void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); //使ledPin为输出模式 } void loop() { val = analogRead(photocellPin); //从传感器读取值 if(val<=512){ //512=2.5V,想让传感器敏感一些的时候,把数值调高, 想让传感器迟钝的时候把数值调低。 digitalWrite(ledPin, HIGH); //当val小于512(2.5V)的时候,led亮。 } else{ digitalWrite(ledPin, LOW); } Serial.println(val); }

Pluggable Optics Modules – Thermal Specifications

Bonnie Mack and Terence Graham 1. Introduction Pluggable optics modules, (POMs), such as SFP, QSFP, QSFP+, QSFP28, CFP, CFP2, and CFP4 transceivers, are optical interface devices that are connected to a PCB through ports in the faceplate. A brief description of these modules is given in Table 1. Initially conceived as low power devices, the module power density has increased along with demand for higher bandwidth. Consequently, it is progressively more difficult to cool these modules. The modules are hot-pluggable and the faceplate port utilizes a PCB-mounted cage. These cages are folded sheet metal enclosures that press fit into the PCB and provide connector alignment and electromagnetic compatibility (EMC) features as shown in Figure 1. The cages generally prevent heatsinking to modul...

Save Constellation Diagram as Picture from Matlab

Matalb able to provide a Constellation Diagram of mulation signal with below command. hScope = comm.ConstellationDiagram; step(hScope,rxSig) But we are not able to save it as a picture. that is because Matlab hide some menubar of the figure. We can show them with below code: shh = get(0,'ShowHiddenHandles'); set(0,'ShowHiddenHandles','On') set(gcf,'menubar','figure') set(gcf,'CloseRequestFcn','closereq') set(gcf,'DefaultLineClipping','Off') set(0,'ShowHiddenHandles',shh) Then you can see the diagram windows looks as below:

Sublime Text 支持 LaTeX

安装Latextools 通过安装工具,搜索安装LaTexTools Ctrl+shift+P, Install Package, LaTexTools 安装SmartPDF 为了支持反向搜索功能 设置SmartPDF,setting,options,在最下方的逆向搜索命令行,输入 "C:\Program Files\Sublime Text 3\sublime_text.exe" "%f:%l" 编译查看文档 Sublime里面 Ctrl+B,或F7即可编译查看文档了。 配置Latextools 默认情况下,LaTeXTools 使用 pdflatex编译,但是现在一般都是用 XeLaTeX,因此,这里还是需要一点改变的。 Preferences, Package Settings, Latex tools, Setting User 在 "builder_settings": { 增加如下内容: "program": "xelatex",

Matlab傅立叶变换

摘要 在本文中将以$x(t)=A\cos(2\pi ft+\phi)$的傅里叶变换为例介绍Matlab中如何进行傅里叶变换,主要介绍以下内容: 用数字方式(离散时间)描述信号$x(t)$ 利用傅里叶变换将离散信号$x[n]$变换到频域$X[k]$ 提取频域信号$X[k]$的幅值和相位谱,及功率谱 由频域信号恢复出时域信号 离散时间域表示 考虑一个正弦波$x(t)=A\cos(2\pi ft+\phi)$,其中$A=4$, $f=2\text{Hz}$,$\phi=\pi/4$(即$30^{\circ}$)。即: \begin{equation}\label{eq:xt} x(t)=4cos(2\pi 2t+\pi/4) \end{equation} 为将时域连续信号(模拟信号)$x(t)$存储到计算机中,我们需对其进行采样,根据Nyquist采样定律,采样频率一般需要大于信号频率的两倍。 下面看看这采样频率为8和32的情形 A=4; f=2; phi=pi/4; duration=2; fs=4*f; t=0:1/fs:duration-1/fs; x=A*cos(2*pi*f*t+phi); figure('Position',[500 300 400 300]) subplot(2,1,1) plot(t,x) hold on stem(t,x,':.','color',[0.5 0.5 0.5]) ylabel('fs=8') hold off fs=16*f; t=0:1/fs:duration-1/fs; x=A*cos(2*pi*f*t+phi); subplot(2,1,2) plot(t,x) hold on stem(t,x,':.','color',[0.5 0.5 0.5]) xlabel('time(s)') ylabel('fs=32')...