It is possible to use Arduino Uno as a function generator to produce low frequency waveform.
The advantage of the approach is the possibility of producing customized, complex, time varying waveform.
On the down side, it cannot produce waveform with very high frequencies.
To get smoother waveform, the PWM output frequency of pin 3 of Arduino Uno is increased to approximately 8 kHz.
It is also possible to use DAC to achieve better results.
Saturday, August 11, 2018
Friday, August 10, 2018
Using MySQL Database with C++ on Various Platforms Including ARM Single Board Computers
In this article, I would like to discuss about using MySQL database with C++.
MySQL is an open source database management system from Oracle.
It not only has freely available version but it is also robust and works on most platforms.
MySQL server can run even on a small 32 bit ARM Single Board Computer (SBC) like Odroid.
It has a lot of functionalities, and user interface too.
That is why, I like to use MySQL database server as an example to be used with C++.
MySQL server can be used as a traditional relational database or a document store where there is no need to define schema, called NoSQL. In a relational database, all the columns of the tables need to be defined in advance. But in a document store, the schema is flexible where it is represented by JSON objects. In order to utilize the advantages of power of relational model and flexibility of the document store, using X DevAPI in C++ applications is discussed.
MySQL server can be used as a traditional relational database or a document store where there is no need to define schema, called NoSQL. In a relational database, all the columns of the tables need to be defined in advance. But in a document store, the schema is flexible where it is represented by JSON objects. In order to utilize the advantages of power of relational model and flexibility of the document store, using X DevAPI in C++ applications is discussed.
Monday, May 14, 2018
MCP3008 - Analog to Digital Converter with SPI Interface
MCP3008 is an 8-channel, 10-bit analog to digital converter from Microchip.
It can be used as 8 single ended analog inputs or 4 differential input pairs. Power supply is 2.7 V to 5 V and its operating temperature is -40 °C to +85 °C. It has an SPI interface which can be operated in mode 0 or mode 3.
It can be used as 8 single ended analog inputs or 4 differential input pairs. Power supply is 2.7 V to 5 V and its operating temperature is -40 °C to +85 °C. It has an SPI interface which can be operated in mode 0 or mode 3.
Friday, March 9, 2018
DIY Smart Surveillance Camera Using Raspberry Pi Camera and C++
Let us make a smart surveillance camera using a Raspberry Pi single board computer.
Normally, it records the videos at 5x speed analyzing continuously and producing video files daily or hourly.
Once human bodies are detected in the captured images, it will highlight them with green rectangles and change the recording speed to normal.
A passive infrared sensor (PIR sensor) is also used to detect human bodies.
The example program discussed here is just to show the feasibility and it can be improved further. A few examples are sending email to your email address if something happened, recognition of faces of family members, recording videos at different speeds depending on time.
The example program discussed here is just to show the feasibility and it can be improved further. A few examples are sending email to your email address if something happened, recognition of faces of family members, recording videos at different speeds depending on time.
Tuesday, January 23, 2018
UDP/TCP Socket Programming with wxWidgets
Introduction
In this article, UDP and TCP socket programming using wxWidgets is discussed. For that wxWidgets needs to be installed in your machine. Installing wxWidgets on Windows and Linux platforms can be seen at the following link.Sockets are used to send and receive data on a network such as the Internet. Almost all modern operating systems support socket layer to transfer data using TCP or UDP. But programming sockets on different platforms usually involves platform specific tweaks. wxWidgets support socket classes which allow you to use sockets for transferring data without concerning about the platform. These classes can be used in various ways and some of them are discussed in the following sections.
Thursday, November 23, 2017
OpenCV with wxWidgets
Introduction
In this article, using OpenCV with wxWidgets is discussed with examples. For that, OpenCV and wxWidgets need to be installed in your system. Installing and using them on Linux and Windows platforms can be found at the following links.- Cross-platform C++ programming with wxWidgets
- OpenCV on Linux using g++, CMake, Qt, Code::Blocks
- OpenCV on Windows Using Visual Studio
Linux
Building an application using OpenCV and wxWidgets in Linux terminal is simple. As an example, a simple program called wxcvsimple.cpp (online) is discussed below. At the start of the program, in OnInit() method of the Application,wxInitAllImageHandlers();is called. Then, wxStaticBitmap variables are declared in MyFrame class, a derived class of wxFrame, to display images. The following code can be used to initialize wxStaticBitmap in the constructor of MyFrame class.
Monday, November 20, 2017
OpenCV on Linux using g++, CMake, Qt, Code::Blocks
Introduction
To install OpenCV on your Linux machine, you need to have the following packages as prerequisites [Ope17g].- GCC 4.4.x or later
- CMake 2.6 or higher
- Git
- GTK+2.x or higher, including headers (libgtk2.0-dev)
- pkg-config
- Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
- ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
- [optional] libtbb2 libtbb-dev
- [optional] libdc1394 2.x
- [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
Monday, October 30, 2017
Cross-platform C++ programming with wxWidgets
Introduction
wxWidgets is a C++ library for creating cross-platform applications. It enables developers to create GUI code to compile and run on several computer platforms such as Windows, OS X, Linux and UNIX with minimal or no code changes.wxWidgets is free and open source software which satisfies those who wish to produce for GPL and proprietary software without license costs [wxW98]. On the other hand, Qt is available for free under LGPLv3 license but has some limitations for commercial use unless you pay the license fee [Qt17].
wxWidgets uses Native platform , therefore GUI has more native look and feel [wxW12]. Qt extends the C++ language but wxWidgets does not extend the C++ language which is less surprising to developers expecting standard C++.
wxWidgets produces small and efficient binary applications. Therefore, it is suitable for embedded systems. In term of library size, Qt library is \(\approx 200\) MB where wxWidgets library is \(\approx 30\) MB.
wxWidgets not only works for C++, but also has bindings for python, perl, php, java, lua, lisp, erlang, eiffel, C# (.NET), BASIC, ruby and even javascript [wxW15a]. wxWidgets is one of the most complete and mature GUI toolkits. There are a lot of utility classes also.
wxWidgets is used by a huge range of organisations and individuals all over the world. Some of the better-known organisations who have used wxWidgets include NASA, AMD, Xerox, and Open Source Applications Foundation (OSAF). wxWidgets applications that you may be familiar with include AVG AntiVirus, Audacity, Filezilla, Code::Blocks, CodeLite.
Wednesday, September 13, 2017
Pixy
Pixy (http://cmucam.org/projects/cmucam5) is a vision system that can be used to add computer vision to your Arduino, Raspberry Pi, or BeagleBone project. Once you have taught it the color to detect, it can send you the position and size of the detected objects.
Thursday, August 3, 2017
KiCad Getting Started Guide in Myanmar Language
KiCad is a suite of free software to design PCBs.[KiCad on Wikipedia].
I have been using it to make PCBs and it is OK so far. It is also easy to use.
It comes with tools to check design rules and to produce Gerber files for manufacturing.
I have written a getting started guide for KiCad in Myanmar language to take note about my experience and methods. And I combined them with English version guide which can be found on its website [Getting Started in KiCad, March 5, 2017].
My Myanmar version getting started guide for KiCad book can be found at
https://yan9a.github.io/KiCad/kicadmm.pdf
https://yan9a.github.io/KiCad/kicadmm.pdf
Subscribe to:
Posts (Atom)


