Jump to content
Rei Vilo

[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!

Share this post


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!

Share this post


Link to post
Share on other sites

Thanks man..... im such a noob with this and actually i dont like the idea to depend on someone elses libraries, but i really appreciate this.... im gonna have a lot of fun with my boards now.

Share this post


Link to post
Share on other sites

 

Thanks man..... im such a noob with this and actually i dont like the idea to depend on someone elses libraries, but i really appreciate this.... im gonna have a lot of fun with my boards now.

 

You're welcome! Analysing someone else code is the best way to learn.

 

Enjoy!

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

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().

Share this post


Link to post
Share on other sites

Bonjour @roadrunner84

 

Thanks for the nice addition! As I'm living in Europe, extended characters are required.

 

I've investigated the customs characters as you did but soon generated an extended char set to meet all the strange letters we use in Europe!

 

Here are some of them:

Share this post


Link to post
Share on other sites

I know replying to old topics is bad practice, but I wanted to share an extension to the library with you.

Why should it be considered as a bad practice?

 

At the contrary, it means the library is used and even maybe useful!

Share this post


Link to post
Share on other sites

Bonjour @roadrunner84

 

Thanks for the nice addition! As I'm living in Europe, extended characters are required.

 

I've investigated the customs characters as you did but soon generated an extended char set to meet all the strange letters we use in Europe!

 

Here are some of them:

post-29838-0-14820600-1392973121_thumb.png

Share this post


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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×