Skip to main content

Building static library on Netbeans [Windows]


   1.       Setup NetBeans IDE.

-          Download and install  NetBeans:  https://netbeans.org/downloads/

   2.       Install   Arduino Plugin for NetBeans.

-          Open NetBeans IDE.
-          Select Tools -> Plugins -> Available Plugins, Select Arduino-plugin in the list and  install

   3.       Install  Arduino IDE.

-          Download Arduino IDE : https://www.arduino.cc/en/Main/Donate
-          Note:
o    Name of installed folder of Arduino is not allowed to have space, by default Arduino is installed in folder: C:/Program Files/~ – having space in name, so Netbeans will not see the Arduino Tools.

   4.       Installi  Cygwin for  Windows.

-          Based on your OS's architecture  you select   32 or 64 bit version in this link https://cygwin.com/install.html.
-         Select packages to install in  Devel Group:
o   Gcc-core: C compiler
o   Gcc-g++: C++ Compiler.
o   Gdb: GNU debugger.
o   Make: the GNU version of ‘make’ utility
o   Cmake.

   5.       Add  Cygwin's path to system path variable.

-           Based on your installed folder of Cygwin so you chose suitable path. Example: E:\Soft\cygwin64\bin

   6.       Setup  build tool for Arduino on NetBeans.


-           Run NetBeans and select:  Tools > Options > C/C++, select tab Build Tools and click  Add Button to add   build tools for Arduino.



-          input path of  Arduino Compiler , and no space in all paths

- In Tab  “Code Assistance ” add path to tools for  C Compiler and  C++ Compiler as below.

        7.       Create a Project Arduino and configure.


-          select  board andcomport, select path to installed folder of Arduino.




-          Change some configuration in make file.

-          Click Build and run Arduino project ,  NetBeans  will  build project base on cross compiler specified, than create a  file *.hex and upload to Arduino board through Serial  Comport as flash in Arduino IDE.
-          You can also open  Cygwin terminal  and  cd  to  Arduino project folder and run command  “make upload”

        8.       Create a new execution  project and configure it to become static library project.

a.       Configure project to build static library.
-          After create, build and run executive project, than delete the main.cpp file and add header and source files that you want to create static library.
-          Right click on project , select  property > Build > Configuration Type > Static Library

-          NetBeans  workspace will look like:
-          if you build  project, liabrary file *.a will be created, but the  Output Windows will way that  building is falied , because in the  make file have command to creare hex file and upload to  board, you should disable this command or ignore the error message.
b.       Configure make file to disable creating  file *.hex .

-          Open Make file, search and comment out the command “#” :
“avr-objcopy -O ihex ${CND_ARTIFACT_PATH_${CONF}} ${CND_ARTIFACT_PATH_${CONF}}.hex”
Ø  # avr-objcopy -O ihex ${CND_ARTIFACT_PATH_${CONF}} ${CND_ARTIFACT_PATH_${CONF}}.hex
-          Rebuild lại project và xem kết quả:















Comments

Popular posts from this blog

Mô Hình Hóa Và Điều Khiển Mô Hình Xe - Con lắc ngược (Cart and Pole)

Thông số của mô hình: 1.       Khối lượng thân xe : M=2.0 (kg) 2.       Khối lượng con lắc : m=0.1 (kg) 3.       Chiều dài con lắc : l=0.5( m) 4.         là góc lệch của con lắc theo phương thẳng đứng 5.       x : là chuyển vị của xe. 6.       u : input ngoại lực tác động lên xe. 7.       g=9,81 (m/s 2 )  gia tốc trọng trường . 8.       Hệ thống hoạt động trong môi trường tuyến tính. 9.       Chỉ đo được góc lệch con lắc và vị trí xe. 10. Có nhiễu tác động vào hệ thống. Nhiễu đo vị trí xe có phương sai là 0.01, nhiễu góc lệch con lắc có phương sai 0.001. 11. Sử dụng bộ lọc Kalman để ước lượng trạng thái và lọc nhiễu. Bài toán đặt ra: Bài toán đặt ra là thiết kế bộ điều khiển cho (U ) để con lắc luôn ở vị trí thẳng đứng.  Giải bài toán động lực học. -          Giải phóng liên kết, phân tích lực tác động vào hệ: (Nguồn

Make Raspberry Pi3 as an emulator bluetooth keyboard

IIntroduction Step 1: update and upgrade your system sudo apt-get update sudo apt-get upgrade Step 2: Install Git tool sudo apt-get install git-core Step 3: Clone My Repo git clone https://github.com/quangthanh010290/BL_keyboard_RPI Sep 4: Install cd B L_keyboard_RPI sudo ./setup.sh Step 5: Change the bluetooth name (Optional) open the boot.sh file and find the line ./updateName.sh ThanhLe_Keyboard Change the name you want, example ./updateName.sh Mlabviet_Keyboard Step 6: Reboot then Run the app sudo reboot ./boot.sh Step 7: Modify some bluetooth setting. - Open tmux and switch to Bluetooth Console tmux a - Input these params to the console agent on default-agent scan on discoverable on II. Video Comming soon: - Make RPI as a racing wheel Buy the prebuild image Code and images

Remove boot messages (all texts) in Raspberry Pi Jessie

1. Demo 2. Change rainbow splash screen sudo nano /boot/config.txt add this line to the end of file  disable_splash=1 check if this config take effect (optional) sudo reboot 3. Hide the Raspberry logo sudo nano /boot/cmdline.txt Add this line to end of file  logo.nologo check if this config take effect (optional) sudo reboot 4. Hide boot messages sudo nano /boot/cmdline.txt Add this line to end of file  quiet change console  console=tty1 --> console=tty3 check if this config take effect (optional) sudo reboot 5. Change splash screen copy your custom splash to home directory and replace raspberry's splash.png  sudo cp ~/splash.png /usr/share/plymouth/themes/pix/splash.png check if this config take effect (optional) sudo reboot 6. Hide the cursor Add this line to the file /boot/cmdline.txt vt.global_cursor_default=0 check if this config take effect (optional) sudo reboot 7. Advances and disadvances With this setup, almost logs are hidden, but there is some log that