In this short tutorial I'm going to show to you how to implement , in the Arduino UNO environment, the basic functionalities to work with the TCN75.
Materials needed for this tutorial.
- 1 Arduino UNO board (naturally)
- Arduino IDE (naturally)
- 1 TCN75 (naturally I'll use my own board, see related posts)
- 4 jumper cables
Our tcn75 board is described here:
Ok let's start
This is a preview of
How to use the TCN75 temperature sensor with Arduino
.
Read the full post (635 words, 2 images, estimated 2:32 mins reading time)
On 8th December 2011, ISO has ratified and published as ISO/IEC 9899:2011 the new C11 (C1x) standard for the C programming language. The major changes from the previous standard (C99), as written in the wikipedia, are the following:
The standard includes several changes to the C99 language and library specifications, such as:[6]
Alignment specification (_Alignas specifier, alignof operator, aligned_alloc function, <stdalign.h> header file)
The _Noreturn function specifier
Type-generic expressions using the _Generic keyword. For example, the following macro cbrt(x) translates to cbrtl(x), cbrt(x) or cbrtf(x) depending on the type of x:
#define cbrt(X) _Generic((X), long double: cbrtl, \
default: cbrt, \
float: cbrtf)(X)
If it is possible you should use constant increments instead of multiplies.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i, j;
for(i=0; i<10; i++)
{
j=i*10;
}
}
int main1(void)
{
int i, j;
for(i=0; i<100; i+=10)
{
j=i;
}
}
This is a preview of
Avoid the use of multiplies to optimize your code for speed (C/C++).
.
Read the full post (133 words, estimated 32 secs reading time)
#include <stdio.h>
int main()
{
printf("goodbye, dad\n");
return 0;
}
source: http://www.muppetlabs.com/~breadbox/rip-dmr.html
The GCC provides the capability to generate optimized compiled code. When you are running gcc to compile your code you can choose between a large number of optimization levels using the following switches:
This is a preview of
Ten GCC optimization flags that must be known
.
Read the full post (472 words, estimated 1:53 mins reading time)
This Saturday I've seen the light. For the first time since three months I've had the freedom to do what I want. So I have implemented this simple brainfuck interpreter for Arduino.
I tried it on my Arduino UNO dev board, let me know if you try on other boards.
nglogc is a flexible C logging API, it is released under the LGPL license. The author, Dennis Krzyzaniak, has released a full detailed manual.
In the following lines, the first two paragraphs from the manual, just to understand something about this library.
Introduction
In C, if you are developing a complex application that requires a large number of command line option you should use the getopt function to handle them, if your application needs a small number of command line arguments you can think to manage them with your own code.
This is a preview of
An alternative way to parse command line arguments
.
Read the full post (368 words, estimated 1:28 mins reading time)
In C A function pointer is a type of pointer. When dereferenced, a function pointer can be used to invoke a function and pass it arguments just like a normal function. Function pointers can be used to simplify code by providing a simple way to select a function to execute based on run-time values.
During the developing phase of programs for my customers, I have to think that they can use the CTRL-C combo to interrupt the execution of my code.
In some cases, for example in a program that makes only some computations, I can avoid catching this event.
This is a preview of
How to trap the CTRL-C on MAC OS X and Linux
.
Read the full post (636 words, estimated 2:33 mins reading time)
Latest Comments