2011-04-04

Pinguino32X, new compiler

Regis and Jean Pierre just finished a working compiler from scratch for use with PIC32, now we have a working C/C++ compiler for use with Pinguino32X.

Here a small sample of C++ use:
/*-------------------------------------------------------
 ledcpp.pde
 Description: Toggle Led in C++
 Author:   Régis Blanchot
 First Release: 03-04-11
 Last Release: 03-04-11
 Boards:   UBW/EMPEROR
 Arch:    32-bit
---------------------------------------------------------*/
float pi;
class Led{
 public:
  Led(){
   TRISEbits.TRISE2 = OUTPUT;
  }
  void on(){
   PORTEbits.RE2 = ON;
  }
  void off(){
   PORTEbits.RE2 = OFF;
  }
  void tog(){
   PORTEbits.RE2 ^= 1;
  }
}; // ";" required
void setup(){
}
void loop(){
 Led myled;
 
 myled.tog();
 
 delay(500);
 
}

Nenhum comentário: