Jump to content
43oh

[Energia Library] for Educational BoosterPack (LaunchPad)


Recommended Posts

The Educational BoosterPack comes with no ready-to-use library and no out-of-the-box software. 

I really like the educational challenge for the users: looking for the specification sheets, reading and understanding them, writing the libraries from scratch or adapting existing ones.

Obviously, I've developed my own library on Energia for the Educational BoosterPack.

 

But what should I do?

  • keep the true educational challenge intact?
  • or release the library?

Just answer the poll! Poll closed, see answer and result below!

Link to post
Share on other sites

I wasn't sure to release the library for the Educational BoosterPack but the poll at 43oh gave an overwhelming result for the release of the library.

 

So here it is, with three examples: EducationalBoosterPack_Library.zip

  • display the X-, Y- and Z- angles from the accelerometer
  • display a RGB colour based on sound, with green=low, yellow=medium, red=high, white=record! (pictured)
  • adjust the contrast of the LCD and the font size

 

263417932.jpg

 

Enjoy!

Link to post
Share on other sites
  • 2 months later...
  • 1 month later...

I am having some trouble getting these libraries and example codes to work with Energia. Do I need xcode for these to work? I just copied and pasted the files into the appropriate folders and tried to load the LCD example but I got a number of compile errors. I'll post them if you need more info

Link to post
Share on other sites

I am having some trouble getting these libraries and example codes to work with Energia. Do I need xcode for these to work? I just copied and pasted the files into the appropriate folders and tried to load the LCD example but I got a number of compile errors. I'll post them if you need more info

 

That's strange because, although the library was developed with embedXcode, the library and the examples were fully tested with Energia.

 

I've just tested it again and experienced no issue:

post-12238-0-29479800-1369649561_thumb.png

Link to post
Share on other sites
  • 8 months later...

I know replying to old topics is bad practice, but I wanted to share an extension to the library with you. I was in the need of displaying custom characters on the LCD, but couldn't find a way to do this wit the current library.

Unfortunately the ebpLCD class uses private to hide its internal members (like the write() method I use). Would these members have been protected, I could have subclassed it nicely:

class ebpLCDex: public ebpLCD
{
  // Modify ebpLCD class to make private members protected
  public:
    void setCharacter(uint8_t index, const uint8_t bitmap[8])
    {
      write(EBP_LCD_command, 0x38);
      write(EBP_LCD_command, 0x40 | (index << 3) & 0x3f);
      for(uint8_t iter = 0; iter != 8; ++iter)
      {
        write(EBP_LCD_data, bitmap[iter]);
      }
      setRowLine(0, 0);
    }
};

Alternatively, just add this method to the ebpLCD class instead.

 

Usage example:

ebpLCDex lcd;

void setup()
{
  const uint8_t doz_dek[8] =
    {0x1f, 0x2, 0x4, 0x8, 0x10, 0x11, 0xe, 0x0};
  const uint8_t doz_el[8] =
    {0xe, 0x11, 0x10, 0x8, 0x4, 0x8, 0x1f, 0x0};
  const char display[17] = "0123456789\x01\x02"; // zero to el in dozenal
  lcd.begin();
  lcd.clear();
  lcd.setCharacter(1, doz_dek);
  lcd.setCharacter(2, doz_el);
  lcd.print(display);
}

The index can be a value between 0 and 7 (inclusive) and writing thecharacter with that binary value will write it to the screen (8 to 15 write the same characters).

The bitmap contains five bits of display information per byte; the most significant three bits of the bitmap bytes are not used. Each of those bytes describe one row of pixels in a character, so bitmap[0] describes the top row and bitmap[7] describes the bottom row of the character.

On 8051projects I found an interactive character editor, that will provide you with the bytes to pass to setCharacter().

Link to post
Share on other sites

Well, there's an additional problem with the table, as the ASCII codes don't correspond to the ISO-8859-1 norm.

 

Extended characters are coded using Unicode UTF-8 on my Mac so I designed a function to covert Unicode UTF-8 into ISO-8859-1. 

 

Other platforms like Windows or Linux may use another coding system for the extended characters.

 

Arduino, and thus Energia, aren't supposed to support extended characters, but I'm using Xcode  :smile:

 

The char type is limited of 0x00..0x7f and often returns 0xffffffxx for values above 0x7f, for example 0xfffffff4 for 0xf4. The trick is to use an uint8_t.

Link to post
Share on other sites
  • 7 months later...

Ok, I'm a bit confused (which is not all that unusual).  I thought that the Educational Booster Pack code originally targeted at the 430 had been ported to Stellaris.  I downloaded a library from here:

 

http://embeddedcomputing.weebly.com/libraries.html

 

that says "Educational BoosterPack Library for LaunchPad MSP430 and Stellaris with Energia".  But looking at the source code for the POT example distributed with the library, I see:

 

#if defined(__MSP430G2553__) || defined(__MSP430G2452__) // LaunchPad specific
#else // error
#error Platform not defined
#endif

 

And indeed commenting out the #ifdef results in compile errors within the library, most of which appear to be that the code references pins with the Pn_m style references which clearly won't fly unmodified on Stellaris.

 

So is there another version of the Educational Booster Pack library for which I should be looking?

 

Thanks for any help you can provide. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...