larsie 121 Posted September 3, 2012 Share Posted September 3, 2012 Firstly I must say thank you for porting the Arduino stuff onto MSP430. You've done such a great job! I've made a first attempt of porting the library for the LCD that's available in the 43oh.com store onto Energia. (Edit: See a post below which display this is for, since there are several LCD boards in the store). It's C-based, not C++. Should I port it to C++? Would that be better? I've tested on the 2452, in which case the bitbanging code should be triggered. I have not yet tested on 2553. Here's the example code of using the library. Please say if you'd like it to be different. Within the multi-library environment, my naming doesn't quite seem appropriate. #include void setup() { pinMode(P2_5, OUTPUT); SPISetup(); clear(); } void loop() { digitalWrite(P2_5, HIGH); // Backlight connected to P2_5 (differs) writeString(0,0,"Hello"); writeString(0,1,"How are you?"); writeString(0,2,"Good!"); writeString(0,3,"Energia Rocks!!"); writeString(0,4,"Buy an LCD in"); writeString(0,5,"43oh.com store"); delay(10000); // wait for a second digitalWrite(P2_5, LOW); // Backlight connected to P2_5 (differs) delay(100); } LCDBoosterpack.zip Quote Link to post Share on other sites
larsie 121 Posted September 3, 2012 Author Share Posted September 3, 2012 Here is one in C++. Edit: uses bitbanging for both types of chips. Example code: #include LCDBoosterPack lcd; void setup() { pinMode(P2_5, OUTPUT); lcd.init(); lcd.clear(); } void loop() { digitalWrite(P2_5, HIGH); // Backlight connected to P2_5 (differs) lcd.writeString(0,0,"Hello"); lcd.writeString(0,1,"How are you?"); lcd.writeString(0,2,"Good!"); lcd.writeString(0,3,"Energia Rocks!!"); lcd.writeString(0,4,"Buy an LCD in"); lcd.writeString(0,5,"43oh.com store"); delay(10000); // wait for a second digitalWrite(P2_5, LOW); // Backlight connected to P2_5 (differs) delay(100); } LCDBoosterPack-cpp-bitbanging.zip Quote Link to post Share on other sites
Rickta59 589 Posted September 3, 2012 Share Posted September 3, 2012 Have you looked at the SPI code in Energia. It would be nice if you used that as it would allow your code to be portable between all the chips we support. Quote Link to post Share on other sites
larsie 121 Posted September 3, 2012 Author Share Posted September 3, 2012 No, haven't done that yet. Should be quite simple to port to that I guess. How would I include the SPI-library inside my LCD-library? For some reason the SPI-code didn't work for 2553, so I'm now defaulting to bitbanging on both the chip-types. Bitbanging works. I need the MOSI to be on the P1.7 for both chips because of the boosterpack. I would guess your SPI switches them, if it uses the HW-pins? Quote Link to post Share on other sites
Rickta59 589 Posted September 3, 2012 Share Posted September 3, 2012 I need the MOSI to be on the P1.7 for both chips because of the boosterpack. I would guess your SPI switches them, if it uses the HW-pins? Yes it makes the appropriate swap based on the chip being used. It does use HW. Quote Link to post Share on other sites
Rei Vilo 695 Posted September 4, 2012 Share Posted September 4, 2012 Please find two examples to Energia: energia, larsie and bluehash 3 Quote Link to post Share on other sites
larsie 121 Posted September 4, 2012 Author Share Posted September 4, 2012 These also use bitbanging, right? And just so our readers don't get confused, the library I added is for a different display. The ones in the store on the following links (display is an SPI-based Powertip PE9665WRF with the ST7579 controller) http://store.43oh.com/index.php?route=p ... duct_id=78 and http://store.43oh.com/index.php?route=p ... duct_id=79 CorB's RF meter (not using the Energia library directly, but his code is embedded into it) Quote Link to post Share on other sites
Rei Vilo 695 Posted January 13, 2013 Share Posted January 13, 2013 Here is a library for the Nokia 5110 display on Energia using hardware SPI. Speed is faster! Main thread is at http://forum.43oh.com/topic/2876-energia-library-nokia-5110-lcd-boosterpackbreakout-pcb/?p=27616 Enjoy Distribution.zip Quote Link to post Share on other sites
rpitts 0 Posted January 24, 2013 Share Posted January 24, 2013 I'm a newb here, and I can't seem to figure out how to write a string variable to the LCD. String Input; while (Serial.available() > 0) { int Receiver = Serial.read(); Input += (char)Receiver; if (Receiver == '\n') { Input.replace("\n", ""); lcd.writeString(0,4,Input); Input = ""; } } results in error lcdboosterpack.h:24:6: note: no known conversion for argument 3 from 'String' to 'char*' What am I doing wrong here? Thanks ! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.