有利用過進度條的朋友一定會感覺很不輕易
因為要從0~100讀取 華侈時間
因檔案巨細也不知道這時間讀寫的完嗎?
如這篇
Java Swing 若何使用進度
於是經過批改
改成此方式
可行使DIALOG準確的抓到讀寫完成的時候
- processdialog.setTitle("Copying files to USB");
- processdialog.add(labelimg);
- processdialog.setLocation(400,250);
- processdialog.pack(); // Packs the dialog so that the JOptionPane can be seen
- processdialog.setVisible(true); // Shows the dialog
- new Thread(){網頁設計
- public void run(){
- try{
- Process process = null;
- BufferedReader input = null;
- final Runtime runtime = Runtime.getRuntime();
- //extact tar for ext3 file
- String tarstring = "tar -xvpf /"+tarpath+"/"+cellValue+".tar -C "+extpatition+"/";
- process = runtime.exec(new String[]{"/bin/sh","-c",tarstring});
- InputStream stdout = process.getInputStream ();
- InputStreamReader osr = new InputStreamReader (stdout);
- BufferedReader obr = new BufferedReader (osr);
- process.waitFor();
-
- Thread.sleep(2000);
- }catch(Exception e){
- e.printStackTrace();
- }finally{
- processdialog.dispose();
- }
- }
- }.start();
marshabaopb 發表在 痞客邦 留言(0) 人氣()
marshabaopb 發表在 痞客邦 留言(0) 人氣()
ESP32 腳位34 毗鄰到可變電阻腳位 2
ESP32 腳位VIN 毗鄰到可變電阻腳位 1
ESP32 腳位GND 毗鄰到可變電阻腳位 3


讀取數值為12 bits = 4096
0 - 4095
程式碼:
- const int potPin = 34;
- int val=0;
- void setup() {
- Serial.begin(115200); //連線速度
- delay(1000);
- }
-
- void loop() {
- // put your main code here, to run repeatedly:
- val = analogRead(potPin); //讀取電壓數值
- Serial.println(val); //印出電壓數值
- delay(500); //延遲0.5秒
- }
marshabaopb 發表在 痞客邦 留言(0) 人氣()
- <script>
- $(function() {
- $("#myTable").tablesorter({ sortList: [[0,0], [1,0]] });
- });
- </script>
複製代碼
marshabaopb 發表在 痞客邦 留言(0) 人氣()
marshabaopb 發表在 痞客邦 留言(0) 人氣()
典範榜樣圖片

CSS
- body{ text-align:center;}
- *{ margin:0; padding:0;}
- img{ border:none;}
- #container{ width:900px; height:900px; background:#000000; border:1px solid #006633; margin:auto; padding:0;}
- #loader{ width:480px; margin:auto; height:500px; background:#FFFFFF; float:left; margin-right:5px;}
- #imageOptions{ float:left;}
- #imageOptions li{ list-style:none; margin:10px;}
- .loading{ background:url(images/spinner.gif) center center no-repeat;}
- h3{ line-height:500px;}
|
marshabaopb 發表在 痞客邦 留言(0) 人氣()

影片
文章出處:網頁設計,網站架設 ,網路行銷,網頁優化,SEO - NetYea 網頁設計
marshabaopb 發表在 痞客邦 留言(0) 人氣()
材料:
18650電池*2
ESP32*1
TB6612FNG*1
蜘蛛機械人*2

marshabaopb 發表在 痞客邦 留言(0) 人氣()
用ESP32 PWM實現LED漸漸亮起。
程式的部份首要分成三個:1.設定頻道LEDchannel、2.附加到PIN腳、3.決意輸出巨細。
1.設定頻道LEDchannel屬性
ledcSetup(LEDChannel, freq, resolution);
//LEDChannel設定為0,不同輸出要設定到分歧頻道,例如RGB LED就要開三個頻道離別管理R、G、B
//freq輸出頻率,建議值5000 Hz
//resolution代表輸出解析度,例如8代表0-255,10代表0-1023
2.附加到PIN腳
ledcAttachPin(ledPin, LEDChannel);
//ledPin代表腳位,看你把裝備接在哪一個腳位上面
//LEDchannel代表步驟1所宣佈的LEDchannel,也就是說把設定好的LEDchannel屬性附加到某個腳位上
3.決定輸出巨細。
ledcWrite(LEDChannel, dutyCycle);
//將LEDchannel輸出dutyCycle的值。
典範程式將使接在Pin16的LED逐步亮起並熄滅,範例複製於 https://randomnerdtutorials.com/esp32-pwm-arduino-ide/


- // the number of the LED pin
- const int ledPin = 16; // 16 corresponds to GPIO16
-
- // setting PWM properties
- const int freq = 5000;
- const int ledChannel = 0;
- const int resolution = 8;
-
- void setup(){
- // configure LED PWM functionalitites
- ledcSetup(ledChannel, freq, resolution);
-
- // attach the channel to the GPIO to be controlled
- ledcAttachPin(ledPin, ledChannel);
- }
-
- void loop(){
- // increase the LED brightness
- for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){
- // changing the LED brightness with PWM
- ledcWrite(ledChannel, dutyCycle);
- delay(15);
- }
-
- // decrease the LED brightness
- for(int dutyCycle = 255; dutyCycle >= 0; dutyCycle--){
- // changing the LED brightness with PWM
- ledcWrite(ledChannel, dutyCycle);
- delay(15);
- }
- }
marshabaopb 發表在 痞客邦 留言(0) 人氣()