HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Dec 08, 2012, 09:24 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Yippee!
Working - Multiwii - Ywrobot IIC / I2C Serial 2.6" LCD 1602

Hi
Well i posted this on MultiWii forum.
IIC / I2C Serial 2.6" LCD 1602
by SadSack Thu Dec 06, 2012 5:39 am

I've got MultiWii 328P Flight Controller w/FTDI & DSM2 Port and very slowly getting ready for flight!
Well built frame/esc so on in few hours, software i stopped counting

IIC / I2C Serial 2.6" LCD 1602 http://dx.com/p/arduino-iic-i2c-serial- ... lay-142567
I've edited config.h and changed address 0x68>0x27. I do get some output "0←"
I've changed libraries and can get it working with examples.

Well I'm struggling to make sense as to what I'm doing wrong or if its supported.
thanks, Phil

Well found this and it's the same module aside from Y instead W

mopi007 wrote:
I bought a LCD Wrobot 1602 on ebay because it is cheap, but it need the LiquidCrystal_I2C library so , i changed the code like this and put here for some body need it :
the code is ok with multiwii V1.9

in Config.h
CODE: SELECT ALL
#define LCD_Wrobot // LCD Wrobot 1602 , which is i2c



Would i add this to 'MultiWii.ino' if so where
Getting little tricky..


mopi007 wrote:
in .pde :
CODE: SELECT ALL
#if defined(LCD_Wrobot)
i2c_Wrobot_init();
i2c_Wrobot_set_cursor(0,0);LCDprintChar("MultiWii" );
i2c_Wrobot_set_cursor(0,1);LCDprintChar("Ready to Fly!");
#endif


I can only find 'C:\arduino-1.0.2\hardware\tools\avr\doc\avr-libc\examples\stdiodemo\lcd.h'
Do i add it to that? Don't sound right but at this point haven't got a clue so maybe ??


mopi007 wrote:
in LCD.h
to void LCDclear() :
CODE: SELECT ALL
#if defined(LCD_Wrobot)
// i2c_LCD03_send_cmd(12); // clear screen
i2c_LCD03_Clear();

#endif

to void LCDsetLine(byte line)
CODE: SELECT ALL
#if defined(LCD_Wrobot)
i2c_Wrobot_set_cursor(0,line-1);
#endif

to void LCDprint(uint8_t i)
CODE: SELECT ALL
#if defined(LCD_Wrobot)
i2c_Wrobot_send_char(i);
#endif


to initLCD()
CODE: SELECT ALL
#if defined(LCD_Wrobot)
// LCD03
i2c_Wrobot_init();
#endif


to to LCDclear();
after : #if !defined(LCD_TEXTSTAR) && !defined(LCD_ETPP) && !defined(LCD_LCD03)
put :
CODE: SELECT ALL
&& !defined(LCD_Wrobot)


before void LCDclear()

CODE: SELECT ALL
#if defined(LCD_Wrobot)
// *********************
// I2C Wrobot modifier loic
// *********************
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void i2c_Wrobot_init () {
lcd.init();
lcd.backlight();
}
void i2c_Wrobot_Clear(){
lcd.clear();
}

void i2c_Wrobot_send_char (char c) {
lcd.print(c);
}

void i2c_Wrobot_set_cursor (byte col, byte row) {
lcd.setCursor(col, row);
}

#endif //LCD_Wrobot


Well i finally got my DMS2 Satellite too bind!! Only took me few weeks of trying. So really would like this working.
So guess I'm asking if someone would do it for me More and cut and paste guy!
Thanks, Phil
SadSack is offline Find More Posts by SadSack
Last edited by SadSack; Dec 12, 2012 at 04:22 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Dec 08, 2012, 11:46 PM
Registered User
VA
Joined Nov 2009
2,682 Posts
I don't have a clue about it either but am curious about how these patches will do. Don't forget to install "LiquidCrystal_I2C" library into Arduino1.0 and to set config.h for your config and sensors. Don't know squat but I luv cut and paste
pug398 is offline Find More Posts by pug398
Reply With Quote
Old Dec 09, 2012, 06:31 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Well thank you very much. Kinda given up on it for now.
I'll get right on it now!

Phil
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 09, 2012, 11:01 AM
Registered User
VA
Joined Nov 2009
2,682 Posts
Fair warning that cut and paste job was done kinda late. Changes made to config.h, multiwii2_1.ino and lcd.ino. Most went into lcd.ino. It seemed to fit and compile but can't test so...Good Luck!

Quote:
Originally Posted by SadSack View Post
Well thank you very much. Kinda given up on it for now.
I'll get right on it now!

Phil
pug398 is offline Find More Posts by pug398
Reply With Quote
Old Dec 09, 2012, 03:29 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Pug398 your a star!! Wished my cut&paste was as good
Few minor issues ie screen wouldn't initialize. By luck while checking libraries was correct i ran 'hello world' then without powering down i loaded your code. I saw MultiWii quadx 2.10 but power down try again just black blocks. Still you did you hard bit now just simple bits now. Ok taken all day to get this far mind and still not done LOL!
Now I've got my Spektrum to bind have another problem... I have a futaba12FG+SpeckyDMS29 module. Had i got RX i could figure out channel order, plug in servo take few mins. This should sort that problem https://github.com/jbudworth/SpektrumSatRx. Then i can check out Menu on my working LCD.

My comment :
"Well thank you very much. Kinda given up on it for now.
I'll get right on it now!"

What i should have said was ...up till your help I'd all but given up.
Sorry for sounding ungrateful.

Phil
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 09, 2012, 10:24 PM
Registered User
VA
Joined Nov 2009
2,682 Posts
Phil I didn't take it that way and glad you saw something relating to multiwii on the screen Not initializing huh? I will see if I see anything right off but I may have reached my limit
pug398 is offline Find More Posts by pug398
Reply With Quote
Old Dec 10, 2012, 09:48 AM
Registered User
VA
Joined Nov 2009
2,682 Posts
slight booboo on my part. The initialization code isn't even called in lcd.ino. The lcd i2c library doesn't accept lcd.init it uses lcd.begin. I had removed lcd.init and replaced with lcd.begin but for whatever reason the paste didn't take. When you get a chance try replacing lcd.init(); with lcd.begin(); like shown below in lcd.ino and see what it does.

#if defined(LCD_Wrobot)
// *********************
// I2C Wrobot modifier logic
// *********************
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void i2c_Wrobot_init () {
lcd.begin();
lcd.backlight();
}
void i2c_Wrobot_Clear(){
lcd.clear();
}

void i2c_Wrobot_send_char (char c) {
lcd.print(c);
}

void i2c_Wrobot_set_cursor (byte col, byte row) {
lcd.setCursor(col, row);
}

#endif //LCD_Wrobot
pug398 is offline Find More Posts by pug398
Reply With Quote
Old Dec 10, 2012, 12:13 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by pug398 View Post
slight booboo on my part. The initialization code isn't even called in lcd.ino. The lcd i2c library doesn't accept lcd.init it uses lcd.begin. I had removed lcd.init and replaced with lcd.begin but for whatever reason the paste didn't take. When you get a chance try replacing lcd.init(); with lcd.begin(); like shown below in lcd.ino and see what it does.

#if defined(LCD_Wrobot)
// *********************
// I2C Wrobot modifier logic
// *********************
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void i2c_Wrobot_init () {
lcd.begin();
lcd.backlight();
}
void i2c_Wrobot_Clear(){
lcd.clear();
}

void i2c_Wrobot_send_char (char c) {
lcd.print(c);
}

void i2c_Wrobot_set_cursor (byte col, byte row) {
lcd.setCursor(col, row);
}

#endif //LCD_Wrobot
This works fine so far ...

Code:
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);

void i2c_Wrobot_init () {
lcd.init();
lcd.backlight();

}
void i2c_Wrobot_clear(){
lcd.clear();
}

void i2c_Wrobot_send_char (char c) {
lcd.print(c);
}

void i2c_Wrobot_set_cursor (byte col, byte row) { 
lcd.setCursor(col, row);
}

#endif //LCD_Wrobot
And my LiquidCrystal_I2C

Code:
###########################################
# Syntax Coloring Map For LiquidCrystal_I2C
###########################################

###########################################
# Datatypes (KEYWORD1)
###########################################

LiquidCrystal_I2C	KEYWORD1

###########################################
# Methods and Functions (KEYWORD2)
###########################################
init	KEYWORD2
begin	KEYWORD2
clear	KEYWORD2
home	KEYWORD2
noDisplay	KEYWORD2
display	KEYWORD2
noBlink	KEYWORD2
blink	KEYWORD2
noCursor	KEYWORD2
cursor	KEYWORD2
scrollDisplayLeft	KEYWORD2
scrollDisplayRight	KEYWORD2
leftToRight	KEYWORD2
rightToLeft	KEYWORD2
shiftIncrement	KEYWORD2
shiftDecrement	KEYWORD2
noBacklight	KEYWORD2
backlight	KEYWORD2
autoscroll	KEYWORD2
noAutoscroll	KEYWORD2
createChar	KEYWORD2
setCursor	KEYWORD2
print	KEYWORD2
blink_on	KEYWORD2
blink_off	KEYWORD2
cursor_on	KEYWORD2
cursor_off	KEYWORD2
setBacklight	KEYWORD2
load_custom_character	KEYWORD2
printstr	KEYWORD2
###########################################
# Constants (LITERAL1)
###########################################
I did this to get it working....

Code:
#elif defined(LCD_LCD03)
  // LCD03 - I2C LCD
  // http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
  i2c_LCD03_init();
#elif defined(LCD_Wrobot)
  i2c_Wrobot_init();  // I cut&paste an extra one here :D
#elif defined(OLED_I2C_128x64)
  i2c_OLED_init();
  #ifndef SUPPRESS_OLED_I2C_128x64LOGO
    i2c_OLED_send_logo();
    #if defined (OLED_I2C_128x64LOGO_PERMANENT)
      i2c_OLED_Put_Logo();
    #endif
#elif defined(LCD_Wrobot)
  i2c_Wrobot_init();

  #endif
#endif
Couldn't figure out how to remove #endif's so added extra one!! Ok dog rough but hey got working main title.
Have got in to menu but still not worked out my channel order. Try again later and try and forget 3 hour i spent this morning only to find i hadn't enabled spektrum in config.h but some how i could get in menu but do nothing other
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 10, 2012, 08:00 PM
Registered User
VA
Joined Nov 2009
2,682 Posts
More than one way to get it done!

Hope you have luck with getting the rx up and running.

edit:
Just found out there is more than one LiquidCrystal_I2C library out there and of course I had the wrong one. They should mark them things
pug398 is offline Find More Posts by pug398
Last edited by pug398; Dec 10, 2012 at 08:14 PM.
Reply With Quote
Old Dec 11, 2012, 07:54 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by pug398 View Post
More than one way to get it done!

Hope you have luck with getting the rx up and running.

edit:
Just found out there is more than one LiquidCrystal_I2C library out there and of course I had the wrong one. They should mark them things
Have to admit it's kicking my ass! But thats the fun

Liquid_i2c libary!!! there's quite a few even changes depending on which Arduino IDE your using
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 12, 2012, 04:36 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Well they work but not perfect. Function Ok can change setting fine and save all i need. V2.10 displays MultiWii 2.10, Quad X but saving/aborting just blank screen.
Dev r1214 lights up and only shows Multiwii V2.11 QuadX when entering setup and blank on exit. Surprised i got this far and if pug398 hadn't done hard bit wouldn't have got this far, so thanks again.

btw Spektrum Sat kicked my ass Futaba + DMS2 9 module. Futaba only outputs 8 channels and OrangeRX Sat can only get 6 Channels!!! And can't sure but looks like MultiWii wants channels not list by Sat. Which I'm gutted about would have been very tidy....hey ho.
SadSack is offline Find More Posts by SadSack
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Crius LCD (Serial LCD v1.03) doesn't work with MultiWii 2.1? xoxota Multirotor Electronics 1 Nov 14, 2012 06:19 AM
Discussion PIC Bit-banging an Arduino I2C LCD Module Gary Warner DIY Electronics 3 Oct 27, 2012 02:16 AM
Discussion I2C and serial GPS drotek Multirotor Electronics 0 Jul 17, 2012 05:19 AM
For Sale Exceed RC Eagle 50 RC Helicopter 2.4Ghz 6-Channel LCD Transmitter flyragwings Aircraft - Electric - Helis (FS/W) 2 Mar 01, 2012 10:48 AM
Serial LCD Displays alibodin DIY Electronics 33 Apr 15, 2005 08:14 PM