發表文章

目前顯示的是 12月, 2017的文章

什麼patch?要怎麼用?

今天收到一個*.patch的檔案, 因為之前廠商有一個範例程式有些問題。 他們做了一些修正。 我本以為他們會把整包改好的程式丟過來, 沒想到是用patch! 如果是Linux/Unix的環境, 本來就是常用patch來做程式的異動, 但他們的環境一直都是在Windows上面的。 這下子真不知如何做了, 找了一下, 發現: https://stackoverflow.com/questions/517257/how-do-i-apply-a-diff-patch-on-windows 有人介紹在Windows可以用Python工具來做: pip install patch python -m patch 於是照做: 先把*.patch檔copy到原先的程式, projects目錄的上一層. 因為我在.patch檔看到如下的內容: diff --git a/projects/target_apps/ble_examples/ble_app_barebone/src/user_barebone.c 想來是用相對目錄, 就如此做了, 也不知有沒有必要如此? 然後下如下指令: G:\DA14585_SDK\6.0.4.326>python -m patch 20171120_0_ancs.patch 沒有出現任何成功或失敗的訊息! 用人工去檢查, 結果是成功的做好了!

Myth about ADXL345 breakout

圖片
  This is my experience about buying AD's ADXL345 accelerometer breakout board.   There are so many breakout boards of ADXL345 sold in the market (or shopping store). Some are very cheap and some are very expensive. Price ranges from NT$ 65 to NT$799. Which one should you buy? What's the difference between the cheap one and expensive one?   I choose to take adventure and buy the cheaper breakout, one for NT$ 65 and one for NT$ 85. And the result, the NT$ 65 one can't work! But the NT$ 85 one work perfectly.   As the picture shows, this ADXL345 breakout board work! The acceleration reading values can be read out. At first I use ST's Nucleo-F401RE development board to connect this NT$ 85 ADXL345 breakout board via SPI interface. And in the MBED online compile web site, I import the ADXL345_HelloWorld sample program to read out acceleration readings.   The first time I run that program, nothing can be readout. Strange! Check the schematic (show below), I fou