Pinguino Control available on Google Play Store !

Pinguino Control is an Android Application that controls a Pinguino PIC32 OTG board in real time, offering the possibility to act on every input and output available of this platform. The user can set Ports/Pins to input or outputs, plus setting their logic state. This App also offers control over the Analog Outputs (PWM) and monitoring of all Analog Inputs implemented on the board. Feedback is also provided, so the user can see what is happening in the board, regardless if it was caused by interaction with the App or directly on the hardware. More about Roberto’s App here.

Pinguino 32 with Android

First test of Pinguino32 with Android is done. We incorporated in Pinguino32X the IOIO ADB library and everything is working fine. My son, Thomas presents here my first Android/Pinguino application ( as usual I drive Led !! )

As most of Android devices are not yet upgraded with Android 2.3.4, we decided to use ADB protocol wich is compatible with Android 1.6 and higher. As usual in Pinguino IDE, you need only 3 instructions to establish a link with an Android device. We are currently working on the release of the Pinguino IDE. It will incorporate Zigbee, ADB and our current job is to incorporate USB Host to connect mouse, keyboard and generally all useful USB devices.

I am very proud of my first Andoid application, even is this one is not optimised as it should be !!


Many thanks to the IOIO project and Ytai Ben-Tsvi, his owner. Most of the job shown here couldn’t be done without the IOIO code.

Temperature Sensor

I built this very simple temperature sensor with a DS18B20. It is connected on a PIC32-PINGUINO and powered from the data line.


The DS18B20 library is very simple to use, just one line to check the temperature on the sensor:

#define ONEWIREBUS 9 // define the pin connected to the 18B20+ Dline

void setup()
{
Serial.begin(9600);
pinMode(8,OUTPUT);
digitalWrite(8,HIGH); // pin 8 is used to power the 18B20 ( +Vcc )
pinMode(10,OUTPUT);
digitalWrite(10,LOW); // pin 10 is used to power the 18B20 ( GND )
}

void loop()
{
TEMPERATURE t;

if (DS18B20.read(ONEWIREBUS, SKIPROM, RES9BIT, &t))
{
if (t.sign) Serial.printf(“-“);
else Serial.printf(“+”);
Serial.printf(“%d”,t.integer);
Serial.printf(“.%d”,t.fraction);
Serial.printf(“\n\r”);
}
}

Now it’s time to connect the DS18B20 and the zigbee shield to have a wireless temperature sensor !!

back view


Front view

ZIGBEE for PIC32

Pinguino32 uses a MRF24J40MA radio module to communicate with another Pinguino32 !!

This shield uses the UEXT connector of PIC32-PINGUINO and PIC32-PINGUINO-OTG. A very simple library is used to communicate with the module. You need only to initialise the module in the setup()

ZIG.init(channel,PAN_ID,Short_Address);

then to send data, you must use the ZIG.send instruction as described below:

ZIG.send(Dest_Address,“TOTO”,4);

each module must be configured with:
– radio channel ( between 11 and 26 )
– PAN ID ( personnal area network identification between 0 and 65535 )
– address ( between 0 and 65535 ).

to receive data from another module, you must use this instruction:

length=ZIG.read(rxdata);

A simple example has been added to the example folder of revision 147 of Pinguino32X.

Have fun
JP

Pinguino as a real time clock

The timer 1 can be used as a real time clock. I wrote this simple example to test this function.
It will be incorporated to the tutorial website.

and this is the code to start the clock and display the result on the serial:


// Real time clock with a 18F2550 and Pinguino
// Jean-Pierre Mandon 2010
byte hours,mins,secs;
void setup()
{
// configure TIMER 1 to be used as RTCC
TMR1H=0x80;
TMR1L=0;
T1CON=0b00001111;

// init current time
hours=12;
mins=0;
secs=0;

// init interrupt for RTCC module
PIE1bits.TMR1IE=1;
INTCONbits.PEIE=1;
INTCONbits.GIE=1;

// init Serial to display time
Serial.begin(9600);
Serial.print(“\r\n”);
Serial.print(“Pinguino clock\r\n”);
}

// timer 1 is interrupt driven
void UserInterrupt()
{
TMR1H=0x80;
PIR1bits.TMR1IF=0;
secs++;
if (secs==60)
{
secs=0;
mins++;
if (mins==60)
{
mins=0;
hours++;
if (hours==24) hours=0;
}
}
}

// The main loop display time on a serial terminal
void loop()
{
if (hours<10) Serial.print(“0”);
Serial.print(hours,DEC);
Serial.print(“:”);
if (mins<10) Serial.print(“0”);
Serial.print(mins,DEC);
Serial.print(“:”);
if (secs<10) Serial.print(“0”);
Serial.print(secs,DEC);
Serial.print(“\r”);
}