有利用過進度條的朋友一定會感覺很不輕易
因為要從0~100讀取 華侈時間
因檔案巨細也不知道這時間讀寫的完嗎?
如這篇
Java Swing 若何使用進度

於是經過批改
改成此方式
可行使DIALOG準確的抓到讀寫完成的時候

  1. processdialog.setTitle("Copying files to USB");
  2.                             processdialog.add(labelimg);
  3.                             processdialog.setLocation(400,250);
  4.                             processdialog.pack(); // Packs the dialog so that the JOptionPane can be seen
  5.                             processdialog.setVisible(true); // Shows the dialog
  6.                             new Thread(){網頁設計
  7.                                     public void run(){
  8.                                             try{
  9.                                                 Process process = null;
  10.                                                 BufferedReader input = null;
  11.                                                 final Runtime runtime = Runtime.getRuntime();
  12.                                                 //extact tar for ext3 file
  13.                                                 String tarstring = "tar -xvpf /"+tarpath+"/"+cellValue+".tar -C "+extpatition+"/";
  14.                                                 process = runtime.exec(new String[]{"/bin/sh","-c",tarstring});
  15.                                                 InputStream stdout = process.getInputStream ();
  16.                                                 InputStreamReader osr = new InputStreamReader (stdout);
  17.                                                 BufferedReader obr = new BufferedReader (osr);
  18.                                                 process.waitFor();
  19.                                                
  20.                                                 Thread.sleep(2000);
  21.                                             }catch(Exception e){
  22.                                                     e.printStackTrace();
  23.                                             }finally{
  24.                                                     processdialog.dispose();
  25.                                             }
  26.                                     }
  27.                             }.start();
文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

 

1.png

文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

ESP32 腳位34 毗鄰到可變電阻腳位 2
ESP32 腳位VIN 毗鄰到可變電阻腳位 1
ESP32 腳位GND 毗鄰到可變電阻腳位 3
1.jpg


讀取數值為12 bits = 4096
0 - 4095

程式碼:

  1. const int potPin = 34;
  2. int val=0;
  3. void setup() {
  4.   Serial.begin(115200); //連線速度
  5.   delay(1000);
  6. }
  7.  
  8. void loop() {
  9.   // put your main code here, to run repeatedly:
  10.   val = analogRead(potPin); //讀取電壓數值
  11.   Serial.println(val); //印出電壓數值
  12.   delay(500); //延遲0.5秒
  13. }
文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

  1. <script>
  2. $(function() {
  3.   $("#myTable").tablesorter({ sortList: [[0,0], [1,0]] });
  4. });
  5. </script>
複製代碼
文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

 

 

文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

典範榜樣圖片

1.png



CSS
  1. body{ text-align:center;}
  2. *{ margin:0; padding:0;}
  3. img{ border:none;}
  4. #container{ width:900px; height:900px; background:#000000; border:1px solid #006633; margin:auto; padding:0;}
  5. #loader{ width:480px; margin:auto; height:500px; background:#FFFFFF; float:left; margin-right:5px;}
  6. #imageOptions{ float:left;}
  7. #imageOptions li{ list-style:none; margin:10px;}
  8. .loading{ background:url(images/spinner.gif) center center no-repeat;}
  9. h3{ line-height:500px;}
文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()

1.png



影片



文章出處:網頁設計,網站架設 ,網路行銷,網頁優化,SEO - NetYea 網頁設計

文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()


材料:
18650電池*2
ESP32*1
TB6612FNG*1
蜘蛛機械人*2


 

7.png

文章標籤

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/

1.jpg

  1. // the number of the LED pin
  2. const int ledPin = 16;  // 16 corresponds to GPIO16
  3.  
  4. // setting PWM properties
  5. const int freq = 5000;
  6. const int ledChannel = 0;
  7. const int resolution = 8;
  8.  
  9. void setup(){
  10.   // configure LED PWM functionalitites
  11.   ledcSetup(ledChannel, freq, resolution);
  12.   
  13.   // attach the channel to the GPIO to be controlled
  14.   ledcAttachPin(ledPin, ledChannel);
  15. }
  16.  
  17. void loop(){
  18.   // increase the LED brightness
  19.   for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){   
  20.     // changing the LED brightness with PWM
  21.     ledcWrite(ledChannel, dutyCycle);
  22.     delay(15);
  23.   }
  24.  
  25.   // decrease the LED brightness
  26.   for(int dutyCycle = 255; dutyCycle >= 0; dutyCycle--){
  27.     // changing the LED brightness with PWM
  28.     ledcWrite(ledChannel, dutyCycle);   
  29.     delay(15);
  30.   }
  31. }
文章標籤

marshabaopb 發表在 痞客邦 留言(0) 人氣()