GLCD DrawBitmap


hallo,

ich bleibe gerade einer stelle in meinem sketch stecken und finde trotz der utft bedienungsanleitung nicht zum ziel.
ich möchte (gegen ende des ersten sketchausschnitts) den doppelpunkt zwischen der stunden und minuten ausblenden. dazu habe ich zwei zeichen angefertigt.

code: [select]

// bibiotheken einbinden
#include <ds3232rtc.h>    // http://github.com/jchristensen/ds3232rtc
#include <time.h>         // http://www.arduino.cc/playground/code/time 
#include <wire.h>         // http://arduino.cc/en/reference/wire
#include <fastled.h>      // http://fastled.io/
#include <utft.h>         // http://henningkarlsen.com/electronics/

const byte data_pin = 6;
const byte num_leds = 8;
#define rgb_order grb;
crgb leds[num_leds];

const byte tft_model = itdb18sp;
const byte tft_cs = 10;   // ss
const byte tft_scl = 13;  // sck
const byte tft_sda = 11;  // mosi
const byte tft_rs = 9;
const byte tft_rst = 8;
utft tft(tft_model, tft_sda, tft_scl, tft_cs, tft_rst, tft_rs);

extern uint8_t sevensegment[];        // 32 x 50px
extern uint8_t sevensegmentdpoint[];  // 32 x 50px
extern uint8_t sevensegmentspace[];   // 32 x 50px

void setup() {
  setsyncprovider(rtc.get);

  fastled.addleds<ws2812b, data_pin, grb>(leds, num_leds);
  memset(leds, 0, num_leds * 3);

  fastled.show();
  tft.initlcd();
  tft.clrscr();
}

void loop() {
  static byte i;
  (int led = 0; led < num_leds; led++) leds[led] = chsv(second() * 4, 255, 127);
  fastled.show();

  static unsigned long lastmillisdisplay;
  static bool secondstate;
  if (millis() - lastmillisdisplay >= 1000) {
    secondstate = !secondstate;
    tft.setfont(sevensegment);
    tft.setbackcolor(vga_red);
    tft.printnumi(hour(), 0, 20, 2, '0');
    //if (secondstate == true) tft.drawbitmap(64,20,32,50,sevensegmentdpoint);
    //else tft.drawbitmap(64,20,32,50,sevensegmentspace);
    tft.printnumi(minute(), 96, 20, 2, '0');
    lastmillisdisplay = millis();
  }
}


code: [select]

#include <avr/pgmspace.h>
[...]

prog_uint8_t sevensegmentdpoint[0xc8] progmem = {
  // :
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x70, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x01, 0xfc, 0x00,
  0x00, 0x01, 0xfc, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00,
  0xf8, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xf8, 0x00,
  0x00, 0x01, 0xfc, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x01,
  0xfc, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x70, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

prog_uint8_t sevensegmentspace[0xc8] progmem = {
  // leerzeichen
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

arduino ide 1.5

ich denke, das problem liegt darin, dass du im drawbitmap-aufruf angibst, dass du 32*50 = 1600 pixel übermitteln willst, dein array aber nur 200 pixel enthält. ich nehme an, du hast mit einem schwarz-weissen bild gerechnet, aber das display stellst 16bittige bilder dar, muss es die informationen ja irgendwo haben.


Arduino Forum > International > Deutsch (Moderator: uwefed) > GLCD DrawBitmap


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support