按照圖片所示進行串連: 光敏電阻的電阻大小與光亮度成反比,通過測量電阻的電壓可以知道光敏電阻的電阻大小,從而知道光亮度。代碼:#define LED_GREEN 9//定義與綠燈串連的引腳#define LED_RED 10//定義與紅燈串連的引腳int brightness = 0; // how bright the LED isint fadeAmount = 5; // how many points to fade the LED byvoid setup(){
Description 介紹Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5
文章目錄 FadingHardware RequiredCircuitSchematicCode FadingDemonstrates the use of the analogWrite() function in fading an LED off and on. AnalogWrite uses pulse width modulation (PWM), turning a digital pin on and off very
1. 查看 bin 目錄下 ntfy.bat 檔案,內容如下: @echo off rem Starts the JacORB Notification Service rem set CLASSPATH="../lib/backport-util-concurrent.jar;../lib/picocontainer-1.2.jar;../lib/antlr-2.7.2.jar" jaco org.jacorb.notification.ConsoleMain
1. 解析IOR字串,需要用到jacorb提供的dior命令。 dior.bat的內容如下: @echo off rem decodes and prints the components of a stringified IOR IF "%1" == "" GOTO USAGE jaco org.jacorb.orb.util.PrintIOR %1 %2 GOTO EXIT :USAGE echo. echo Usage: %0 ^[^<IOR^> ^| -f
1. bin目錄下 idl.bat的內容如下: @echo off rem @JAVA_CMD@ -classpath "@JACORB_HOME@/lib/idl.jar;@JACORB_HOME@/lib/logkit-1.2.jar;%CLASSPATH%" org.jacorb.idl.parser %* set JACORB_HOME=D:/jacorb set JAVA_HOME=C:/j2sdk1.4.2_13 set
1. bin/pingo.bat 內容如下: @echo off rem decodes and prints the components of a stringified IOR jaco org.jacorb.orb.util.PingObject %* 2. 命令如下: D:/jacorb/bin>pingo -i iorstring 通過前面的fixior可以修改IOR字串,這樣就可以測試該功能了。 運行結果如下: D:/jacorb/bin>pingo -i IOR:00