Donnerstag, 14. Februar 2013

Raspi LCD erste Gehversuche

Raspi LCD

 

//--------------------------------------------------------------------------------------------------
// Quelle:
// Author: Martin Steppuhn // History: 05.09.2012 Initial version // 18.10.2012 
// Update vor erster Auslieferung // 05.11.2012 Version 0.9.0
//--------------------------------------------------------------------------------------------------
//=== Includes =====================================================================================
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdio.h>
#include "std_c.h"
#include "bcm2835.h"
#include "raspilcd.h"
#include "lcd.h"
=============================================================================
#include "bmp_raspi.inc"
#include "bmp_men.inc"
//=== Local variables ==============================================================================
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// usage sudo ./test 'Hallo Welt'
// gibt den Text aus der Übergabe aus und schaltet nach 10 s das Licht aus
// der Text bleibt stehen, kann mit Programm clearcld abgeschaltet werden
// int main(int argc, char **argv)
// int main(void)

int main ( int argc, char *argv[] )
{

    char name[40];

  int Contrast,Backlight;
  int i;

  Contrast = 9;
  Backlight = 1;
  DemoView = 0;

  if(!RaspiLcdHwInit()) { printf("RaspiLcdHwInit() failed!\r\n"); return 1; }
  LCD_Init();// Init Display
  SetBacklight(1);// Turn Backlight on

// Schleife um alle Argumete anzuzeige
//  printf("%d Argumente festgestellt\n", argc);
//   for ( i = 0; i < argc; i++ )  {
//      printf("%s\n", argv[i]);   }

   printf("gibt aus auf Raspdisplay -> ");
   printf("%s\n", argv[1]);

  LCD_ClearScreen();
  LCD_SetFont(0);
  LCD_PrintXY(0,4 ,argv[1]);
  LCD_WriteFramebuffer();

SleepMs(10000);
// gets(name);

  SetBacklight(0);// Turn Backlight off
    return 0;
}



 

Keine Kommentare:

Kommentar veröffentlichen