2018年12月17日

led偵測光線

當我看到micro:bit使用25顆LED當光線偵測工具時,真的佩服其想法。也想證實一下。
我使用bpi-bit,在P0接上紅線,GND接上黑線,另一端接上2顆紅色LED燈。

使用arduino ide來偵測程式碼如下:
void setup() {
 Serial.begin(115200); //Serial Port Config 115200-8-N-1
}
void loop() {
  Serial.println(analogRead(P0));
    delay(500);
}

程式很簡單只有顯示P0的類比訊號值。

2018年12月11日

2018年11月22日

bpi-bit mycropython記事


安裝picocom

sudo apt-get install picocom
sudo pip install adafruit-ampy --upgrade

確認 esptool安裝完成

sudo apt-get install esptool
sudo pip3 install esptool

燒錄硬體

下載網址:https://github.com/BPI-STEAM/BPI-BIT-MicroPython/releases
 下載:firmware.bin、AutoErase.py、AutoFlash.py三個檔案。
開啟終端機,輸入:
python3 AutoErase.py
python3 AutoFlash.py

連線到bpi-bit

picocom /dev/ttyUSB0 -b 115200

關閉wifi AP

wifi.close()

執行.py檔案

ampy --port /dev/ttyUSB0 run led.py

Ctrl+A在空行上,輸入原始REPL模式
Ctrl+B在空行上,進入正常的REPL模式
Ctrl+C中斷程序
Ctrl+D軟體重啟
Ctrl+E進入複製貼上程式碼模式,做完貼上使用Ctrl+D執行貼上程式碿
按Ctrl+A 再按Ctrl+Q離開終端機
如果要燒錄進去,則把xx.py程式,改成main.py
sudo ampy --port /dev/ttyUSB0 put main.py
刪除板子上的文件
ampy --port /dev/ttyUSB0 rm led.py
下載檔案到電腦中
ampy -p /dev/ttyUSB0 get xx.py
列出文件
ampy -p /dev/ttyUSB0 ls
清除micropyton重新燒入 
sudo esptool.py --port /dev/ttyUSB0 erase_flash
sudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20180511-v1.9.4.bin

點亮GPIO 18 LED燈

載入machine裡的Pin類別
from machine import Pin
載入時間物件
import time
設定GPIO 18為輸出,GPIO18在bpi-bit正面wf32晶片旁bpi:bit的正方方LED燈
LED = Pin(18, Pin.OUT)
亮燈
LED.value(1)
熄燈
LED.value(0)
 

呼吸燈作法

import machine,time
LED = machine.PWM(machine.Pin(18), freq=1000)
tick = 0 # counter variable
while True:
    if tick < 40:
        # self.tick % 20 gives a number 0 to 19
        # subtracting 9 makes it -9 to 10
        # abs maps it 9 to 0 to 10
        # subtracting from 10 maps it 1 to 10 to 0
        # multiplying by 25 scales it 25 to 250 to 0
        LED.duty((10 - (abs((tick % 20) - 9))) * 25)
        tick = (tick + 1) % 40
        time.sleep(0.1)
注意程式碼階層,python以階層決定程式碼位置。
可以貼在文件編輯器中存成led_pwm.py檔,放終下列執行指令
 ampy --port /dev/ttyUSB0 run led_pwm.py

2018年11月19日

備份mbr

備份
dd if=/dev/sda of=back.mbr bs=512 count=1

sfdisk -d /dev/sda > back.mbr

還原
dd if=/tmp/mbrsda.bak of=/dev/sdb bs=446 count=1
 
sfdisk /dev/sda < /tmp/sda.mbr

 

2018年11月10日

bpi-bit buzzer music

參考midi網址:https://en.m.wikipedia.org/wiki/Scientific_pitch_notation#Table_of_note_frequencies


 #define Buzzer 25   //GPIO 25

// 0 NULL 0.0001
// 5    LG 196.00
// 5.5  #LG 207.65
// 6    LA 220.00
// 6.5  #LA 233.08
// 7    LB 246.94
// 11    C 261.63
// 11.5 #C 277.18
// 12    D 293.66
// 12.5 #D 311.13
// 13    E 329.63
// 14    F 349.23
// 14.5 #F 369.99
// 15    G 392.00
// 15.5  #G 415.30
// 21    A 440.00
// 21.5  #A 466.16
// 22    B 493.88

#define TIME 250       // 1拍時間
#define LEDC_CHANNEL 0    
#define LEDC_TIMER_BIT 13
#define LEDC_BASE_FREQ 5000
double music_star[] = {11,11,15,15,16,16,15,0,14,14,13,13,12,12,11,0,15,15,14,14,13,13,12,0,15,15,14,14,13,13,12,0,11,11,15,15,16,16,15,0,14,14,13,13,12,12,11,0 };
double music_happy[] = {5,5,6,5,11,7,0,5,5,6,5,12,11,0,5,5,15,13,11,7,6,0,0,0,14,13,12,11,0 };
double music_ode[] = {7,7,11,12,12,11,7,6,5,5,6,7,0,6,6,0,7,7,11,12,12,11,7,6,5,5,6,7,6,0,5,5,0};

void setup(){
  ledcSetup(LEDC_CHANNEL, LEDC_BASE_FREQ, LEDC_TIMER_BIT);
  ledcAttachPin(Buzzer, LEDC_CHANNEL);
}

double to_num(double m_n){
double r_n = 0.00;
if (m_n ==5){
  r_n = 196.00;
}else if( m_n ==5.5){
  r_n = 207.65;
}else if ( m_n == 6){
  r_n = 220.00;
}else if ( m_n == 6.5){
  r_n = 233.08;
}else if ( m_n == 7){
  r_n = 246.94;
}else if ( m_n == 11){
  r_n = 261.63;
}else if ( m_n == 11.5){
  r_n = 277.18;
}else if ( m_n == 12){
  r_n = 293.66;
}else if( m_n == 12.5){
  r_n = 311.13;
}else if( m_n == 13){
  r_n = 329.63;
}else if( m_n == 14){
  r_n = 349.23;
}else if( m_n == 14.5){
  r_n = 369.99;
}else if( m_n == 15){
  r_n = 392.00;
}else if( m_n ==15.5){
  r_n = 415.30;
}else if( m_n == 16){
  r_n = 440.00;
}else if( m_n ==16.5){
  r_n = 466.16;
}else if( m_n == 17){
  r_n =493.88;
}else if( m_n ==21){
  r_n =523.25;
}
   return r_n ;
}


void loop(){
  for (int i=0;i<sizeof(music_happy)/8;i++)
  {
  
    if (to_num(music_happy[i]) == 0){
          delay(TIME);
      }else{
        ledcWriteTone(LEDC_CHANNEL, to_num(music_happy[i]));
        delay(TIME);
        }
    }
  
  ledcWriteTone(LEDC_CHANNEL, 0);
  delay(1000);
}

2018年11月1日

micropython 連bpi-bit

apt-get install picocom
 pip3 install esptool

github
 https://github.com/BPI-STEAM/BPI-BIT-MicroPython


燒入micropython韌體
檔案下載
https://github.com/BPI-STEAM/BPI-BIT-MicroPython/releases/tag/beta 

python3  AutoErase.py
python3 AutoFlash.py

連上bpi-bit
picocom /dev/ttyUSB0 -b 115200

關掉wifi指令
wifi.close();

2018年10月12日

bpi-bit led function

要讓led亮燈程式碼
#include <NeoPixelBus.h>
const uint16_t PixelCount = 25;
const uint8_t PixelPin = 4;
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);


#define colorSaturation 128
#define ledPower 2

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200); //Serial Port Config 115200-8-N-1
  strip.Begin();
  strip.Show();
  pinMode(ledPower,OUTPUT);
  digitalWrite(ledPower, HIGH); //It's very important for the v1.2, if you use the v1.4 ,you can delete it

}

void loop() {
  // put your main code here, to run repeatedly:
  strip.SetPixelColor(20, RgbColor (0, 255, 0));
  strip.Show();
  delay(100);
  strip.SetPixelColor(20, RgbColor (0, 0, 0));
  strip.Show();
  delay(100);

}


把led燈滅用副程式來做:在void setup(){}前加入
 void led_black(){
  int i =0 ;
  for ( i =0;i <25;i++){
    strip.SetPixelColor(i, RgbColor (0, 0, 0));
    }
    strip.Show();
}
再把
  strip.SetPixelColor(20, RgbColor (0, 0, 0));
  strip.Show();
兩行改成呼叫副程式一行,以後只要一個副程式即可以把led燈熄滅。
   led_black();




qtqr crash


https://launchpad.net/ubuntu/cosmic/amd64/python-qt4/4.12.1+dfsg-2
下載    deb

wget http://launchpadlibrarian.net/344235582/python-qt4_4.12.1+dfsg-2_amd64.deb

安裝
sudo dpkg -i  python-qt4_4.12.1+dfsg-2_amd64.deb

如果出現相依性錯誤
  dpkg: 因相依問題,無法設定 python-qt4:
 python-qt4 相依於 libqt4-designer (>= 4:4.8.0-1~).
 python-qt4 相依於 libqt4-help (>= 4:4.8.0-1~)﹔然而:
  套件 libqt4-help 未安裝。
 python-qt4 相依於 libqt4-scripttools (>= 4:4.8.0-1~)﹔然而:
  套件 libqt4-scripttools 未安裝。
 python-qt4 相依於 libqt4-svg (>= 4:4.8.0-1~)﹔然而:
  套件 libqt4-svg 未安裝。
 python-qt4 相依於 libqt4-test (>= 4:4.8.0-1~)﹔然而:
  套件 libqt4-test 未安裝。
 python-qt4 相依於 libqtassistantclient4 (>= 4.6.3)﹔然而:
  套件 libqtassistantclient4 未安裝。

dpkg: error processing package python-qt4 (--install):
 相依問題 - 保留未設定
處理時發生錯誤:
 python-qt4


 sudo apt-get -f install
安裝好後再做一次
sudo dpkg -i  python-qt4_4.12.1+dfsg-2_amd64.deb

 wget http://free.nchc.org.tw/parrot/pool/main/q/qr-tools/qr-tools_1.4~bzr23.orig.tar.gz

tar zxvf qr-tools_1.4~bzr23.orig.tar.gz

cd qr-tools-1.4~bzr23

sudo chmod +x qtqr.py

sudo cp qtqr.py /usb/bin/qtqr

40 個 Laravel 開發便捷技巧

保太貼的,有時間要研讀一下
免費電子書: 40 個 Laravel 開發便捷技巧

https://laraveldaily.com/free-e-book-40-laravel-quick-tips-and-counting/

2018年10月10日

bpi-bit arduino 數位類比pwm

使用bpi-bit 在arduino ide上使用數位角位輸出-P2

參考網址:https://www.cnblogs.com/lulipro/p/8046248.html
void setup() {
  // put your setup code here, to run once:
  pinMode(P2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(P2, HIGH);
  delay(500);
  digitalWrite(P2, LOW);
  delay(500);
}

要使用pwm來做呼吸燈


int freq = 5000;
int ledChannel = 0;
int resolution = 8;

void setup() {
   ledcSetup(ledChannel, freq, resolution);
  ledcAttachPin(P1, ledChannel);
 }
void loop()
{
  for (int dutyCycle = 0; dutyCycle <= 255; dutyCycle++) {
    ledcWrite(ledChannel, dutyCycle);
    delay(7);
  }

  for (int dutyCycle = 255; dutyCycle >= 0; dutyCycle--) {
    ledcWrite(ledChannel, dutyCycle);
    delay(7);
  }

}

 

P1類比輸入 

把類比感應器接在P1,使用serial monitor秀出。

void setup() {
  // put your setup code here, to run once:
    Serial.begin(115200); //Serial Port Config 115200-8-N-1
    pinMode(P1, INPUT_PULLUP);
}

void loop() {
  // put your main code here, to run repeatedly:
      Serial.println();
      Serial.println(analogRead(P1));
      delay(500);;

}

P1數位輸入

把數位感應器接在P1(按鈕),使用serial monitor秀出
void setup() {
  // put your setup code here, to run once:
    Serial.begin(115200); //Serial Port Config 115200-8-N-1
    pinMode(P1, INPUT);//Botton B Pin Mode :Digital Input
}

void loop() {
  // put your main code here, to run repeatedly:
  if (digitalRead(P1) == LOW)
    {
      delay(100);
   if (digitalRead(P1) == LOW)
    {
      Serial.println();
      Serial.println(LOW);
    }else{
      Serial.println();
      Serial.println(HIGH);
    }
   }
 
}

2018年10月8日

bpi-bit LED 數位亮燈

arduino ide 實作led亮燈

開一個arduino新檔,板子選擇bpi-bit(板子設定方法請參考https://wdpsestea.blogspot.com/2018/10/bpi-bit-arduino-ide.html ,ubuntu使用者參考https://wdpsestea.blogspot.com/2018/09/bpi-bit-arduino-ide.html ) 選擇連擁port(win下是comX,linux下是ttyUSBX),燒錄速度建議降低些。




void setup() {
  // put your setup code here, to run once:

}
前include下列檔案
我們有25個LED和使用PixelPin 4來溝通。

#include <Arduino.h>
#include <NeoPixelBus.h>
#include "WiFi.h"
//WS2812 config
const uint16_t PixelCount = 25;
const uint8_t PixelPin = 4;
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);


#define colorSaturation 32
//定義WS2812 腳位 2
#define ledPower 2
//定義顏色
RgbColor red(colorSaturation, 0, 0);
RgbColor green(0, colorSaturation, 0);
RgbColor blue(0, 0, colorSaturation);
RgbColor white(colorSaturation);
RgbColor black(0);
HslColor hslRed(red);
HslColor hslGreen(green);
HslColor hslBlue(blue);
HslColor hslWhite(white);
HslColor hslBlack(black);


void setup() {
  // put your setup code here, to run once:

}
中加入
  Serial.begin(115200); //Serial Port Config 115200-8-N-1
  while (!Serial); // wait for serial attach

  Serial.println();
  Serial.println("Initializing...");
  Serial.flush();

  // this resets all the neopixels to an off state
  strip.Begin();
  strip.Show();

  pinMode(ledPower,OUTPUT);
  digitalWrite(ledPower, HIGH); //It's very important for the v1.2, if you use the v1.4 ,you can delete it


在void loop() {
  // put your main code here, to run repeatedly:
           
}
中插入下列
            strip.SetPixelColor(0, red);
            strip.Show();
            delay(100);
            strip.SetPixelColor(0, black);
            strip.Show();
            delay(100);
亮燈,strip.SetPixelColor(0, red);0是第幾個燈按照下圖排列,顏色則按RgbColor定義的內容

 要熄滅則用黑色
strip.SetPixelColor(0, black);
間隔時間使用delay(微秒),1秒=1000微秒。
 delay(1000);


2018年10月4日

bpi-bit 使用arduino ide編輯

arduino ide 不認識bpi-bit這板子,arduino ide要如何設定?
參考文章:https://github.com/BPI-STEAM/BPI-BIT-Arduino-IDE/wiki/windows

1.下載arduino ide  個人使用zip檔案:https://www.arduino.cc/en/Main/Software
 選擇適合自己做業系統的zip,下載後解壓縮。

2.bpi-bit是使用esp32晶片,所以要找到arduino esp32的硬體程式,在https://github.com/espressif/arduino-esp32
下載後解壓縮。改目錄名稱為esp32,放到arduino 1.8.7的hardware目錄下建一個espressif目錄下

感謝Yufong提供,在偏好設定中加入https://dl.espressif.com/dl/package_esp32_index.json,就有bpi-bit的板子可以選。



執行esp32/tools/get.exe

執行arduino 1.8.7,這時就有bpi-bit的板子可以選擇了。

加入全彩LED陣列模組
參考文章:http://wiki.banana-pi.org/Lighting_the_RGB_LED
下載程式庫 Librarys:[NeoPixel_Bus] from Makuna:https://github.com/Makuna/NeoPixelBus
 下載完解壓縮,放到arduino ide的libraries目錄中


啟動arduino ide,點選[工具/管理程式庫],在搜尋框中輸入:neopixe,安裝neopixebus by makuna程式庫。

開啟範例:

 找到這兩行(約第16 17行)
const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure
const uint8_t PixelPin = 2;  // make sure to set this to the correct pin, ignored for Esp8266
改成
const uint16_t PixelCount = 25; // this example assumes 4 pixels, making it smaller will cause a failure
const uint8_t PixelPin = 4;  // make sure to set this to the correct pin, ignored for Esp8266

 (約67行)找到setup()在{下一行加入
#define LED_POWER      2
 pinMode(LED_POWER, OUTPUT);
 digitalWrite(LED_POWER, HIGH);
 
確認你的bpi-bit在哪個com port,就可以燒錄了。燒錄完會看到LED燈亮起。
 
 
gpio 36 39光敏感應
gpio 25 蜂鳴器
gpio 35 按鈕A
gpio 27 按鈕B
gpio 22 I2C_SCL 
gpio 21 I2C_SDA
 https://kknews.cc/news/pprqq5z.html
 https://wiki.banana-pi.org/BPI-Bit_STEAM_%E6%95%99%E8%82%B2%E5%BC%80%E5%8F%91%E6%9D%BF
光敏传感器(L) GPIO 36 Analog Input
光敏传感器(R) GPIO 39 Analog Input
按键 A GPIO 35 Digital Input
按键 B GPIO 27 Digital Input
温度传感器 GPIO 34 Analog Input
蜂鸣器 GPIO 25 PWM(Digital Output) / Analog Output
RGB_LED GPIO 4 Digital Output
九轴传感器MPU9250_SCL GPIO 22 Digital Output
九轴传感器MPU9250_SDA GPIO 21 Digital Output
九轴传感器MPU9250_INT GPIO 16 Digital Input
R_LED(SPI_SCK) GPIO 18 Digital Output


bpi-bit使用webduino編輯器

當bpi-bit接上電腦後,25個全彩LED會顯示出bitxxxx(末4個是數字),使用電腦的wify連上這個AP,例如我的bpi-bit顯示9402這時會出現一個bit9402的AP。
選擇此AP,密碼是12345678。

連上去後在瀏覽器中輸入http://192.168.4.1 ,會看到下圖,此時要輸入可對外連線的SSID和密碼,按下SUBMIT鈕。
接下來會看到板子的ID,很重要,記得複製起來。
 接下來請連上下列網址:https://bit.webduino.io/blockly/?lang=zh-hant

進入編輯頁面,要注意的是在開發板的積木中,要選擇wifi和貼上剛才複製的設備ID(很長那串),再按play鈕,板子才會工作。

如果沒有板子可以選擇摸擬器,ID輸入1234,這時會在預覽視窗中出現程式的結果。



bpi-bit開箱文

拿到了bpi-bit(産品),打開盒子看到如下內容

 它的正面:

它的背面:
wiki上的圖片
簡介:
大小:5公分X5公分 ,重量:10至12公克,cpu:32位元Xtensa LX6雙核處理器,支援Webduino,Arduino,MicroPython以及Scratch X編程,內置20pin 針邊緣連接器,內置照明矩陣,25個可編程全彩LED,兩個光敏光傳感器,兩個可編程按鈕,一個NTC電阻,一個蜂鳴器和一個九軸傳感器(三軸加速三軸陀螺儀和三軸磁羅盤),I / O空間配置如下:
    全彩LED矩陣:GPIO4
    光敏傳感器:GPIO36(模擬A0,左上),GPIO39(模擬A3,右上)
    按鈕開關:GPIO35(Botton A),GPIO27(Botton B)
    溫度傳感器:GPIO34(模擬A6)
    蜂鳴器:GPIO25
    MPU-9250 9軸傳感器:GPIO0,GPIO21(SDA),GPIO22(SCL) 


它的wiki網址:http://wiki.banana-pi.org/BPI-Bit


2018年9月30日

bpi-bit韌體燒錄回weduino版本

如果bpi-bit的韌體版本跑掉了,想回出廠時的版本。依據文件做一次。
https://github.com/BPI-STEAM/BPI-BIT-WebDuino/wiki

參考網址:http://wiki.banana-pi.org/Webduino_firmware_programming

1.下載燒錄軟體
https://www.espressif.com/en/support/download/other-tools

點選esp32
2.解壓縮後,執行ESPFlashDownloadTool_v3.6.4.exe

 3.選擇4列,分别在第二欄填入四個位址x1000、0x8000、0xe000、0x10000,在第一欄選擇相對應檔案:

Filename Address
bootloader_dio_40m.bin 0x1000
partitions.bin 0x8000
boot_app0.bin 0xe000
bit_default.bin 0x10000

四個檔案下載位址:
https://github.com/BPI-STEAM/BPI-BIT-WebDuino
下載後解壓縮,在案在Bin資料夾中

燒錄後,如果出現X符號是沒按按鍵,要先按板子的A鍵不放再按後面的Reset鍵,然後再放掉Reset鍵,聽到蜂鳴器嗶嗶叫時,再放開A鍵。

快速還原方法:
在BPI-BIT-WebDuino-master資料夾中有AutoFlash資料夾,它可以快速還原韌體版本。
先執行AutoErase.exe,清除韌體,再執行AutoFlashWebduinoBin.exe,會自動寫入韌體,寫完後記得要按按鍵A後再按Rest,放掉Rest,聽到嗶嗶聲後放掉A鍵。

2018年9月28日

bpi-bit arduino ide設定

使用bpi bit讓arduino ide認識這塊板子做法:
作業系統ubuntu16.04 18.04
ubuntu使用apt-get  install的版本是2:1.0.5+dfsg2-4

按照
https://github.com/BPI-STEAM/BPI-BIT-Arduino-IDE/wiki#3-debian--ubuntu-os%E5%AE%89%E8%A3%85%E8%AF%B4%E6%98%8E

無法做出來。
我的解決方法(先sudo apt-get install arduino):
sudo usermod -a -G dialout $USER && \
sudo apt-get install git && \
wget https://bootstrap.pypa.io/get-pip.py && \
sudo python get-pip.py && \
sudo pip install pyserial 
 
下載新版的ardino ide
https://www.arduino.cc/en/Main/Software
 我用的是linux amd64 1.8.7版本
https://www.arduino.cc/download_handler.php?f=/arduino-1.8.7-linux64.tar.xz

下載完解壓縮

$tar Jxvf arduino-1.8.7-linux64.tar.xz
$sudo -s
#rm -rf /usr/share/arduino
#mv  arduino-1.8.7 /usr/share/arduino
#cd /usr/share/arduino-1.8.7/hardware/
#sudo mkdir  espressif
#cd espressif
#git clone https://github.com/espressif/arduino-esp32.git esp32
#cd esp32
#git submodule update --init --recursive
#cd tools
#python2 get.py
 
重新啟動arduino ide
在板子中才會有bpi-git可以選擇
 

2018年8月1日

electron in ubuntu

參考文件:https://blog.csdn.net/weifengdq/article/details/70597829

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
 
git clone https://github.com/electron/electron.git
cd electron
# Install as a development dependency
npm install electron --save-dev
 
error
 
vim package.json
"name": "electron" 改为 "name": "electron-test", 存檔
 
# Install as a development dependency
npm install electron --save-dev

# Install the `electron` command globally in your $PATH
sudo npm install electron -g
 
electron版本
electron --version

2018年7月19日

drbl派win10

一間學校想用drbl派win10出現錯誤訊息。
...
*Starting AoE devices discovery and mounting AoE
*Not started.
....
查了是新北用的drbl(六期到現在)時間有點久了,都沒有升級過,用遠端連線進入,做系統升級(apt-get update;apt-get disupgrade),重做drblsrv -i;drblpush -c /etc/drbl/drblpush.conf ,後正常。

新北市自由軟體到校培訓依然會提供服務,有需要的請提出。

2018年7月10日

easy2boot開機隨身碟製作

1.官網:http://www.easy2boot.com/
2.下載E2B+DPMS,google雲端硬碟下載點:https://drive.google.com/folderview?id=0B44X_H05wMHFdmFjcUJJQ0RyZTQ&usp=sharing
找到

 3.格式化隨身碟成為fat32
4.壓縮檔案到隨身碟
 5.開啟終端機,進入隨身碟,sudo -s
6.執行下列指令:
cd _ISO/docs/linux_utils
sudo chmod 777 *
mount
找出隨身碟是在哪裡
sudo lsblk
sudo bash ./fmt.sh

注意訊息選擇正確的設備(目前我的隨身碟是/dev/sdb2),按下y


7.把iso複製到_ISO資料夾中,Linux的放入Linux資料夾中。




cd _ISO/docs/linux_utils
sudo chmod 777 *
mount
sudo lsblk
sudo bash ./fmt.sh


Read more: http://www.easy2boot.com/make-an-easy2boot-usb-drive/make-using-linux/
cd _ISO/docs/linux_utils
sudo chmod 777 *
mount
sudo lsblk
sudo bash ./fmt.sh


Read more: http://www.easy2boot.com/make-an-easy2boot-usb-drive/make-using-linux/

2018年7月6日

EDU2018-ubuntu作業系統

EDU2018-ubuntu作業系統
基於ubuntu 18.04
安裝電腦教室常用軟體:libreoffice、VLC、tuxpaint、....
特別功能:開放硬體(arduino ide、ArduBlock、transformer、micro:bit),心智圖xmind、電子電路、3D列印(cura)、檔案總管nautilus可以預覽stl檔、使用者開關機還原、inkscape支援雷雕gcode輸出、scratch2 offline支援背景輸入中文。
缺點:scratch2 offline輸入中文需要用滑鼠切換輸入法。
下載點:https://drive.google.com/open?id=1E5X6Eld0db4zokXbK1dY3mDwUSQ8yAbT


2018年5月9日

microbit模擬滑鼠(on scratch2)

使用micro:bit來模擬mouse,想到的是使用是xyz的值和按鈕
使用bdesigner來當中介程式
偵測板子的x移動會有L和R兩個值
偵測板子的y移動會有B和F兩個值

2018年5月3日

ubuntu 18.04 沒有 gksu

ubuntu 18.04找不到gksu套件,解決方法
增加套件源
cat <<EOF | sudo tee /etc/apt/sources.list.d/artful.list
deb http://archive.ubuntu.com/ubuntu/ artful main universe
deb-src http://archive.ubuntu.com/ubuntu/ artful main universe
EOF 

更新套件
sudo apt update
安裝指令 
sudo apt install gksu
 

2018年3月6日

openshot無法新增動畫字幕

這不是正解,先這樣解決問題
原因可能是blender的版本問題
我的做法
1.下載blender  linux檔案並解壓縮:https://drive.google.com/open?id=1Aj0-i00n2gIx0SX-O3-0Md2MbnnkPfHe
2.備份原始檔案
sudo mv /usr/share/blender /usr/share/blender-bak

3.把2.62的版本放回目錄中
sudo mv ~/Downloads/blender-2.62-linux-glibc27-x86_64 /usr/share/blender

4.刪除/usr/bin/blender  /usr/bin/blenderplayer
sudo rm /usr/bin/blender
sudo rm /usr/bin/blenderplayer

5.重做連結
sudo ln -s /usr/share/blender/blender /usr/bin/blender
sudo ln -s /usr/share/blender/blenderplayer /usr/bin/blenderplayer

2018年2月11日

擷錄影片vcd

有人麻煩我處理vcd轉mp3,本想很簡單,但沒想到是有點麻煩的光碟。
首先想用拷貝方式複製.dat檔,結果,出現誤訊息無法複製。
用vlc播放,只有一首,從頭到尾,有時還沒有聲音。
用k3b燒錄光碟成為iso,也是無法成功。
正在煩惱時看到k3b有[擷取影像cd]功能試了一下,竟然成功了。


有了mpeg檔案,用ff multi comverter來轉成mp3,就解決了問題了。