Archive

Archive for the ‘The Prince: C’ Category

How to use the TCN75 temperature sensor with Arduino

January 13th, 2012 No comments

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

Working with the TCN75 temperature sensor

January 9th, 2012 No comments

How to use the TCN75 temperature sensor

In this article I'm going to show to you how to use the TCN75 we have mounted on our boards.

The TCN75 is a very simple temperature sensor but at the same time it is very accurate, with a precision of ±0,5 ° C, fra 25°C≤ TA ≤ 100°C e ±3 °C -55°C≤ TA ≤ +125°C.

The new ISO C11 standard for the C language

January 3rd, 2012 No comments

 

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)

Working with the RTCC MCP 79410 RTCC (Real Time Clock with Calendar)

December 30th, 2011 No comments

How to use the MCP79410 Real Time Clock

In this article I'm going to show you how to use the MCP 79410 we have mounted on our boards.

The MCP79410 is a Real Time Clock (RTC) chip that uses a digital compensation of the time to realize an accurate clock/calendar. It has a programmable output line (it is possible to program up to two alarms), it can be backupped by an external battery (there is an ad hoc circuit), it has a small non volatile memory to store data and a small backupped SRAM.

How to use the i2c bus with PIC12f1840 (a simple library)

December 23rd, 2011 No comments

We have developed this library to use the i2c bus on our 12f1840 development board.

http://www.xappsoftware.com/wordpress/?p=3523

http://www.xappsoftware.com/wordpress/?p=3428

Naturally it can be used also with our PICcoletta board and with other boards which use Microchip PICs. Leave a message to this post if you find useful this library or if you use this library with other PICs.

Avoid the use of multiplies to optimize your code for speed (C/C++).

November 25th, 2011 1 comment

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;
    }
}

The second release candidate of Arduino 1.0 is available

October 26th, 2011 No comments

 

 Arduino1  

Summary of changes in Arduino 1.0.

Download

The second release candidate of Arduino 1.0 is available (as of October 25, 2011):

The source code is hosted in the new-extension branch on GitHub: https://github.com/arduino/Arduino/tree/new-extension

Dennis Ritchie: 1941-2011

October 19th, 2011 No comments

 

#include <stdio.h>

int main()
{
    printf("goodbye, dad\n");
    return 0;
}


source: http://www.muppetlabs.com/~breadbox/rip-dmr.html

Ten GCC optimization flags that must be known

October 15th, 2011 1 comment

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:

Brainfuck For Arduino

October 2nd, 2011 1 comment

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.

Statistical data collected by Statpress SEOlution (blogcraft).