Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Arduino Nano works only one time and then the computer does not recognize it on: January 20, 2013, 08:16:52 am
Ok you convinced me smiley I will wire Test to GND, its going to be like performing heart surgery on those SMD pins.
2  Using Arduino / Project Guidance / Re: Arduino Nano works only one time and then the computer does not recognize it on: January 19, 2013, 07:44:14 pm
I did see this solution (pin grounding) on another post http://arduino.cc/forum/index.php?topic=28280.0 but in my case I have I programmed my nano repeatedly for months and now all of a sudden I am getting this error on 2 different Nanos, using multiple different cables. If it was something wrong with the nano circuitry then why has it worked for so long?
I can get it working again by uninstalling the driver and plugging the device back in which I had to do on each usb port, but sometimes it will still not recognize and I have to go through the uninstall process again. Will keep you posted if I find anything.
3  Using Arduino / Project Guidance / Re: Arduino Nano works only one time and then the computer does not recognize it on: January 18, 2013, 09:48:37 am
Hello,
I bought a Nano from Littlebird electronics and another through ebay. The first one I have uploaded to it many of times and had some trouble with data corruption so I bought the other one to ensure that it was not the chips fault. To my discovery it was my software that was causing the issue. Any way my point is that I have had 1 nano which I have uploaded maybe 50 times and another also 50 times now as I keep swapping and changing. Now I can not connect to either of them because my windows 7 keeps telling me that the device has not installed correctly. I have pointed windows to the Arduino drivers and still no solution. This has been happening for a while on some of my usb ports but if I changed to a different port it would install correctly. Now all of my ports (4 of them) will not install the correct drivers. What is going on here it seems like a common problem but do not see any solutions. Why has this suddenly happened, is it windows update that has caused this?
4  Using Arduino / Programming Questions / Re: Passing Char* into custom library on: March 18, 2012, 08:55:46 am
Well I finally got it to work and thought id update this post to make it complete, just in case there is someone else out there that is confused about the pointer to array of pointer concept. So here is my code.

Thanks for you help PaulS

Code:
/*
  menu.h - Library for handling LCD menus
  Created by Colin Wildsmith, March, 2012.
*/

#ifndef menu_h
#define menu_h
#include "Arduino.h"

class menu
{
  public:
    menu(char** MenuItems);
    String lcdDisplay(boolean lineCursor);
  private:
    char** _MenuItems;
};

#endif

Code:
/*
  menu.h - Library for handling LCD menus
  Created by Colin Wildsmith, March, 2012.
*/

#include "Arduino.h"
#include "menu.h"

menu::menu(char** MenuItems)
{
  _MenuItems = MenuItems;
}

String menu::lcdDisplay(boolean lineCursor)
{
if (lineCursor == true) {
return _MenuItems[0];
}
else {
return _MenuItems[1];
}
}
5  Using Arduino / Programming Questions / Re: Passing Char* into custom library on: March 16, 2012, 05:35:54 pm
Thankyou, I appreciate your response. It is quite clear now you point that issue out eg char* (MenuItems) to String (_MenuItems).

However, I made the following changes and am still getting problems.

Code:
/*
  menu.h - Library for handling LCD menus
  Created by Colin, March, 2012.
*/

#ifndef menu_h
#define menu_h
#include "Arduino.h"

class menu
{
  public:
    menu(char* MenuItems[]);
    String lcdDisplay(boolean lineCursor);
  private:
    char* _MenuItems;
};

#endif

The error is
\menu.cpp: In constructor 'menu::menu(char**)':
\menu.cpp:11: error: cannot convert 'char**' to 'char*' in assignment

I have not changed the menu.cpp menu so it is the same as the previous post.
What is a char** ?
How do I pass an array of strings?

6  Using Arduino / Programming Questions / Passing Char* into custom library on: March 15, 2012, 09:05:06 am
Hello, I was hoping someone could give me some help in regard to the program I am writing. I am getting the following errors:
\arduino-1.0\libraries\menu\menu.cpp: In constructor 'menu::menu(char**)':
\menu.cpp:11: error: incompatible types in assignment of 'char**' to 'String
  • ' (This is not showing up properly in the post it should be' Square bracket 0 square bracket')

I am creating a library to manage all the menu lists for a 2 line LCD screen and want to pass it an array of strings which it can send back to the program the stings in focus depending on the screen pointer. I will eventually have many menus so hence the need for a class/library.

My arduino code is as follows:
Code:
#include <Wire.h>
#include <menu.h>
#include "LiquidCrystal_I2C.h"

LiquidCrystal_I2C lcd(0x27,16,2);
char* mainMenuItems[] = {"Menu Item 1","Menu Item 2","Menu Item 3","Menu Item 4"};
String topLine = "TopLine";
String botLine = "BotLIne";
menu mainMenuInst(mainMenuItems);

void setup()
{
  lcd.init();
  lcd.backlight();
}

void loop()
{
  topLine = mainMenuInst.lcdDisplay(false);
  botLine = mainMenuInst.lcdDisplay(true);
  //This be the print function
  lcd.clear();
  lcd.print (topLine);
  lcd.setCursor(0, 1);
  lcd.print (botLine);
  delay(250);
}

Then I have my header file for my '"menu" library, menu.h

Code:
/*
  menu.h - Library for handling LCD menus
  Created by Colin Wildsmith, March, 2012.
*/

#ifndef menu_h
#define menu_h
#include "Arduino.h"

class menu
{
  public:
    menu(char* MenuItems[]);
    String lcdDisplay(boolean lineCursor);
  private:
    String _MenuItems[];
};

#endif

And finally the crux of my library obviously in its beginning stages, menu.cpp
Code:
/*
  menu.cpp - Library for handling LCD menus
  Created by Colin Wildsmith, March, 2012.
*/

#include "Arduino.h"
#include "menu.h"

menu::menu(char* MenuItems[])
{
  _MenuItems = MenuItems;
}

String menu::lcdDisplay(boolean lineCursor)
{
if lineCursor = true {
return _MenuItems[0];
}
else {
return __MenuItems[1];
}
}

Thanks in advance
Typoon
Pages: [1]