Hi! In this blog entry I'll show you how to setup a development environment to develop and compile code for Microchip's PIC microcontrollers. We'll need three main packages:
  1. gputils - a collection of tools for the Microchip (TM) PIC microcontrollers. It includes gpasm, gplink and gplib.
  2. sdcc - small device C compiler
  3. piklab - an integrated development environment (IDE) for applications based on Microchip PIC and dsPIC microcontrollers similar to the MPLAB environment. It integrates with several compiler and assembler toolchains. It supports the most common programmers (serial, parallel, ICD2, Pickit2, Picstart+), the ICD2 debugger, and several bootloaders (Tiny, Pickit2 and Picdem).

Today I had to merge multiple PDFs into a single PDF and had no clue on how to do it. It was fairly easy to find out how to do it and I decided to share it. First you have to install two programs
sudo apt-get install gs
sudo apt-get install pdftk
Then you just have two open a console and run the following command
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=resulting_file.pdf -dBATCH file1.pdf file2.pdf file3.pdf
And that's just it. You can change the final document's name from "resulting_file.pdf" to whatever you want and add as many files as you want to be merged into a single PDF.

Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)


How to use OpenCV with CMake and Codeblocks on Ubuntu

Continuing the previous posts on How to Install OpenCV 2.3.1 in Ubuntu 11.10 Oneiric Ocelot with Python support and How to use CMake ith OpenCV now I'll show you how to use both OpenCV and CMake with Codeblocks IDE. Codeblocks is an open source, cross platform, free, great C++ IDE built to meet the most demanding needs of users. It is very extensible and fully configurable. I have been using codeblocks for about 2 years and I never felt the need to change to another IDE. It supports debugging and code completion which are very useful features.

(Click the photo for better resolution in Picasa Photostream)
In Ubuntu 11.10 Oneiric Ocelot it is pretty easy to add a custom shortcut. Just clink the icon on the upper right of the screen, then System Settings > Keyboard > Shortcuts > Custom Shortcuts ( I'm not sure if this names are exact since my Ubuntu is in portuguese, but it should be something like this ). Then you just have to click the "+" to add a new shortcut, name it and write it's command. After that, apply and then define the keypresses that will call such command. As an example, I defined a shortcut named Banshee which calls the command "banshee" when I press Shift+F4.

Pretty easy, right? However, if you use desktop effects you won't be able to add a shortcut that runs a script the same way, since metacity is not your window manager. Compiz is.

How to use CMake with OpenCV

CMake is a cross platform, open-source build system. It consists in a family of tools designed to build, test and package software. It is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates makefiles that can be used in the compiler environment of your choice.

OpenCV is an open-source computer vision library which was already mentioned in this blog (see How to install OpenCV 2.3.1 in Ubuntu 11.10 Oneiric Ocelot with Python support).

This "how to" will guide you through the process of using CMake to compile and build OpenCV projects. It is based on the tutorial made by Damiles but has some minor changes.

OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. It is written in C/C++ and is used worlwide in many computer vision applications.

This "how to" is a mix of two other great tutorials on OpenCV installations: A Compreehensive Guide to Installing and Configuring OpenCV 2.3.1 on Ubuntu from ozbots.org; and the OpenCV Installation Guide on Debian and Ubuntu from the OpenCV Wiki. I used this procedure to successfully install OpenCV on two amd64 computers (a laptop and a desktop) running Ubuntu 11.10 Oneiric Ocelot. However, if you find any problem you can check the Comprehensive OpenCV Installation Troubleshooting Guide from ozbots.

First Post

Hi there! This is the inauguration post of this blog. I hope you like the contents that I’ll post around here from now on. Most of them will be about robotics, electronics, computer science, hacks, etc. However, sometimes and not very often I may publish some stuff about other random topics. It is possible that sometimes I may also publish something in portuguese, if case of topics related to other portuguese students. Anyway, you can always use google translator to read them, or learn portuguese :P . Basically, this first post is all about “I hope you enjoy reading whatever I publish here”.