
- #Gnu octave android how to
- #Gnu octave android serial
- #Gnu octave android software
- #Gnu octave android code
- #Gnu octave android Pc
Since 1-2 are irrelevant to this tutorial we will not explain the details.
#Gnu octave android how to
If you look inside the file you will see lot of code, worry not! You just need to execute help srl_plot in the Octave prompt to get an explanation on how to use the function. This is the function we call to plot the data. In the attachments at the bottom of this page you will find the srl_plot.m file containing the homonymous function. If you have written a de-serealization function in C or C++ let me know so we can port it to GNU Octave and we post it here! Step 2: The plotting function

GNU Octave can be integrated with C/C++ very easily.
#Gnu octave android code
Save this into the file deserializeInt.m 3 or download the code form the bottom of this page (remember to rename the file to deserializeInt.m). Finally, the function bitpack in line 3 interprets each of the binary numbers as a uint16, that is, it will consume 8 bits to generate a single uint16 number. The function cell2mat in line 4 converts the cell back into a matrix. This converts the array into a cell (a more general container) of binary numbers (bit arrays). Lines 5-8 applies the function bitget(x,1:8) to every element of the data array. In our case the MSB will contain only 2 bits with information, since we will not send values bigger than 1023. Below there is an example, the fun number 707 is written in binary and separated in its least significant byte (LSB) and its most significant byte (MSB).
#Gnu octave android serial
To send an unsigned int over the serial we will break it up in bytes and send one after the other. So we need to store these values in a datatype that is bigger than unsigned char, the best type would be an unsigned int (ansi C guarantees this datatype to be of at least 2 bytes, i.e.

This is more than 1 byte, but less than 2 bytes. This is due to the fact that the digital to analog converter of the board has 10 bits resolution (2^10-1 = 1023). Now, you may have noticed that the values returned by the light sensor in the light measurement tutorial go up to 1023. What is the biggest integer number that we can store in 1 byte? Easy, we have 8 bits therefore 2^8-1 = 255 is the biggest integer. In the ansi C language the datatype unsigned char is guaranteed to be at least 1 byte in size and therefore is the type used in serial communication. This means that we can send, in a single event, the value of a variable of size 1 byte. When we use the serial communication in the Dwengo board the data size is, by default, 8 bits (this is 1 byte). Step 1: Sending analog sensor values over Serial Once you have got it working come back and continue from here. To start you need to follow the light measurement tutorial. Part 1: Dwengo sideįirst we are going to show how to send sensor values over the serial port. In this case, we are going to send to the computer the values generated by the light sensor introduced in the light measurement tutorial and we are going to plot these values using GNU Octave.
#Gnu octave android Pc
This tutorial shows the basics of sending data to the computer for further analysis ( Is the brain of your robot not powerful enough? send data to a PC for analysis!).


#Gnu octave android software
One of the applications it includes is gnuplot, a software application by means of which function graphics can be generated and that integrates perfectly with the development language proposed by Octave. To do so, Octave includes some applications for this specific purpose. This software, that in reality is nothing more than a set of libraries to carry out calculations, and obtain numerical, graphical and simulation results that can later be analyzed. From there on, its development has moved forward without stopping until it has become one of the best mathematics programs. The first references of Octave date back to 1988 when people started thinking about it as a brilliant complement for a university book about chemical reactor designing.
