How to Format an SD Card after using it on a Raspberry Pi (Windows Disk Management)

Whenever you install a Raspberry Pi Operating System (Raspbian, Ubuntu Mint, etc.) on an SD Card you will get two drives. One is formatted in FAT32 and the other in Linux Filesystem Format.

On the photo above here the SD card has 2 drives. E: and F:.

E: FAT32 42.4 MB Max Size
F: Linux File System ????

Note: There is actually a way to know what specific file system and how big it is for the Drive F:. I am avoiding it on this post as it would complicate matters.

Note: You may get a different drive for your SD Cards with Raspberry Pi OS when you insert them on Windows.

You can read more about SD Card Disk Partitions when using it for a Rasberry Pi here.

Now when you want to use an SD Card back to like using it on your Android Phone or camera, you just cannot use it by simply inserting it on the SD Card slot and turning on your gadget. You have to properly format the SD Card.

Note: If this method does not work for you, I will be writing another method for Windows, Mac and Linux systems in the future.


Problem

If you format separately the two drives (E: and F:), you will end up with two drives instead of one that has the full capacity of the SD Card.

Continue reading How to Format an SD Card after using it on a Raspberry Pi (Windows Disk Management)

Arduino Uno Schmitt Trigger Voltage Logic Levels

I wanted to know the Schmitt Trigger Voltage Logic Levels for the Arduino Uno since I want to know on what voltage would the digital input pin detect a logic high or a logic low.

I know that the Arduino Uno uses the ATmega328 with a 5V as its voltage supply. I checked the ATmega328 specification sheet and since it was too long to read (TL;DR), I would rather check using a Signal Generator and an Oscilloscope.



The Setup

Here is the list of equipment that I used for doing this experiment

  • Arduino Uno powered via USB port
  • Laptop (Windows)
  • 2-Channel Oscilloscope (PicoScope)
  • Signal Generator

Continue reading Arduino Uno Schmitt Trigger Voltage Logic Levels

How to use Synergy on Raspberry Pi

I have always used Synergy when using multiple computers since I do not want to use a lot of hardware (mouse and keyboard) to control all my unit. When I first received a Raspberry Pi the first thing I did was make Synergy work.

Here is the configuration that I use when working with Raspberry Pi.

  • Client – Raspberry Pi (to be controlled)
  • Server – Laptop where the mouse and keyboard will be used (Windows/Mac)
Screenshot of Synergy on a Windows computer.

1. Installing Synergy on Raspbian

Open the terminal and run the code below.

This will install Synergy on the Raspberry Pi along with its dependencies.

Continue reading How to use Synergy on Raspberry Pi

How to use C++ Classes in Arduino IDE without creating a Library

If you looked inside an Arduino Library you would see filename extensions such as .h and .cpp, which makes us conclude that the Arduino IDE uses C++ for its codes. If you look inside those files most of the Arduino Libraries have C++ classes inside of them. The question now is: Can you use C++ Classes in Arduino IDE without Creating a Library?

The answer to that is YES!

It is a bit tricky though as there are rules you need to follow. I shall dive into that later.

Sample Code

Below is a short Arduino Code with a C++ Class without using a Library.

Okay, I admit that was not very short. At least you can see that I have used a C++ Class without creating a library. You can compile it in your Arduino IDE if you still do not believe me. You can see the Circuit Diagram somewhere below, there is also a Fritzing Diagram if you want to seriously test it.

You can check the code in my Github here. Continue reading How to use C++ Classes in Arduino IDE without creating a Library

Project Diary: Self Balancing Robot

I have always wanted to make a self-balancing robot. This post will be a diary on my journey to making one.

I’ll be updating this post as I go along this journey complete with details of the success and frustrations, pictures and expenses.


December 5, 2017 (Tuesday)

Ordered and paid for LSM9DS1 Breakout board from Circuit-Help. This one has an Accelerometer, Gyroscope and Magnetometer in a single board which would really be helpful for this project.
https://www.circuit-help.com.ph/product/adafruit-9-dof-accelmaggyrotemp-breakout-board-lsm9ds1/

After much research I saw a LSM9DS0 Breakout board in Lazada, much more expensive (₱ 1,446/pc) but has a higher accuracy than the LSM9DS1. Since I already bought the LSM9DS1 Breakout Board I just have to live with my decision.

Expenses for the day

Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board – LSM9DS1 ₱ 905
Shipping (via LBC Express) ₱ 160
TOTAL ₱ 1,065

Total Expense so far: ₱ 1,065


December 6, 2017 (Wednesday)

Circuit-help messaged me that they have already shipped the product. Hopefully, tomorrow it will arrive. Continue reading Project Diary: Self Balancing Robot

Arduino MapFloat Library Documentation

I have always used the Arduino IDE map function but have not been able to use it for float values. With these I have made the MapFloat Library so that I could extend the map function to floating point numbers.

A very useful feature when I want to have decimal places on my map function.


Introduction

A library that contains the mapFloat function which re-maps a floating point number from one range to another. The mapFloat function is inside the MapFloat library.

This library is based on the Arduino Map Function.

Here is a link to the reference of Arduino Map Function.
https://www.arduino.cc/reference/en/language/functions/math/map/

Installing the MapFloat Library

Download the MapFloat Library from RadishLogic’s Github repository.
https://github.com/radishlogic/MapFloat

Clone or Download >> Download ZIP. This will download the file MapFloat-master.zip.

Unzip the MapFloat-master folder inside the zip file and paste it on the library folder where your Arduino IDE is installed. Continue reading Arduino MapFloat Library Documentation

SD Card Partitions when installing Raspbian for Raspberry Pi

From the very start that I used a Raspberry Pi I have always been curious about how it partitions the microSD Card every step of the Raspbian installation to running the Raspberry Pi.

You will see below on what happens to your SD Card Paritions every step of the installation to running the Raspbian on your Raspberry Pi.


Testing Parameters

SD Card Sizes

I shall be using 2 SD Card memory sizes, 8GB and 16GB. The reason for me using these memory sizes is for us to see if there are any differences on the SD Card Partitions depending on the SD Card size.

Checking of the SD Card Partitions

I shall use Partition Wizard on Windows 10 to check the SD Card partitions as it has a graphical representation of the different partitions and it can detect Linux and Mac file systems. Continue reading SD Card Partitions when installing Raspbian for Raspberry Pi

Using an External Text Editor in Arduino IDE

Whenever I program an Arduino based project I would always use Sublime Text as my editor then compile and upload using the Arduino IDE. I prefer using Sublime Text as my Arduino Sketch editor as it gives more flexibility on color highlighting.

This post is a tutorial on how to use Sublime Text as an External Editor. It also answers the why, advantages and disadvantages of using External Editor.

In case you prefer to use Atom Text Editor than Sublime Text then you may still do so by opening your code on Atom Text Editor.

(Left) Sublime Text; (Right) Arduino IDE
Both editors are showing the same stripped down version of the Blink code.

Continue reading Using an External Text Editor in Arduino IDE

Setting Arduino .ino files to open as C++ files in Sublime Text

I have always preferred developing in Sublime Text especially for Arduino Projects since the syntax highlighting is better than doing it in Arduino IDE. Unfortunately, it is annoying to keep opening .ino files on Sublime Text then set the syntax highlighting to C++ (.cpp) on each file.

Luckily, there is a way to do this automatically so that whenever I open a .ino file it will always open with a C++ syntax highlighting in Sublime Text. Below are the steps on how I did it.

Modified version of the Blink code in Arduino IDE
Modified version of the Blink code in Arduino IDE

Note: My Sublime Text is configured to use the Color Scheme named Sixteen.


1. Open a .ino file in Sublime Text

In my case I created an Arduino Sketch, saved it then opened it in Sublime Text.  Continue reading Setting Arduino .ino files to open as C++ files in Sublime Text

Making an SD Card as Permanent Storage in Windows 10

I am using a laptop which only has 32GB for its main storage. Unfortunately, this becomes full quickly if I will be installing a lot of programs and add some cloud storage to it.

Fortunately, the computer has a microSD Card slot which I can use to expand my storage, but I could not install programs or put my cloud storage directory to it since it is not recognized as a Permanent Storage by Windows.

The microSD Card slot on my laptop

Do not worry, though, there is actually a way to make the Windows see your SD Card as a Permanent Storage. Below are the steps that you need to do.

Note: This tutorial would also work on Windows Tablet who also has the same problems as I have.

1. Make sure that your SD Card is formatted to NTFS

To be able to mount the SD Card as a Permanent Storage it must be formatted to the same file system as your computer’s main storage file system. For Windows 10 case the main file system is NTFS.

Usually SD Cards are formatted in FAT32 but let us check first. Continue reading Making an SD Card as Permanent Storage in Windows 10