Code Monkey home page Code Monkey logo

Comments (3)

geeksville avatar geeksville commented on July 23, 2024

Apparently that screen is 64x32 pixels? When it boots do you see 1/4th of the meshtastic logo? If so I would recommend the following next steps:

  • In screen.cpp, wrap SCREEN_WIDTH and SCREEN_HEIGHT definitions with an #ifdef BOARD_MAKERHAWK (which you will also define in configuration.h, so we can eventually make this a standard supported board)
  • For MAKERHAWK use 64x32 ;-)
  • Change the following code in screen.cpp:

old code:

void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
    // Demonstrates the 3 included default sizes. The fonts come from SSD1306Fonts.h file
    // Besides the default fonts there will be a program to convert TrueType fonts into this format
    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(ArialMT_Plain_16);
    display->drawString(64 + x, 2 + y, "Bluetooth");

    display->setFont(ArialMT_Plain_10);
    display->drawString(64 + x, SCREEN_HEIGHT - FONT_HEIGHT + y, "Enter this code");

    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(ArialMT_Plain_24);
    display->drawString(64 + x, 22 + y, btPIN);

    ui.disableIndicator();
}

new code:

#ifdef BOARD_MAKERHAWK
// devices with tiny screens need to use tiny fonts
#define FONT_LARGEST ArialMT_Plain_10
#else 
#define FONT_LARGEST ArialMT_Plain_24
#endif 

void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
    DEBUG_MSG("Trying to pair bluetooth PIN %s\n", btPIN);
    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(ArialMT_Plain_16);
    display->drawString(SCREEN_WIDTH/2 + x, 2 + y, "Bluetooth");

    display->setFont(ArialMT_Plain_10);
    display->drawString(SCREEN_WIDTH/2 + x, SCREEN_HEIGHT - FONT_HEIGHT + y, "Enter this code");

    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(FONT_LARGEST);
    display->drawString(SCREEN_WIDTH / 2 + x, 22 + y, btPIN);

    ui.disableIndicator();
}

^ this quick hacked up code is probably not exactly correct - but you can see changed my yucky absolute screen positions to be more relative to SCREEN_WIDTH. I also generalized the font selection so a tiny font is used on your device. Other functions in screen.cpp will probably also need to be tweaked to nicely look good on your device and the otehr devices. I also added a DEBUG_STR to print the pairing code to hte serial port so you can get past this point without the screen fully working.

I'm happy to help if you have more problems and I'd love a pull request once you have a nice clean set of changes needed to support your board.

from firmware.

geeksville avatar geeksville commented on July 23, 2024

@peoplesdriver - just checking in, did you ever do anything with this?

from firmware.

geeksville avatar geeksville commented on July 23, 2024

Ok - no word from @peoplesdriver - closing for now

from firmware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.