Show Posts
Pages: [1] 2 3 ... 16
1  Using Arduino / Programming Questions / Re: Problems with strings and &chars on: September 19, 2014, 03:45:58 pm
Yes, like in VB, which I use a lot.
2  Using Arduino / Programming Questions / Re: Problems with strings and &chars on: September 19, 2014, 11:19:06 am
My thanks to you all.

I have again misremembered that "string" is name of variable type and not just an array of chars.

This is what I tried to do.
Code:
void gtcha (char (&stra)[100])
But it is too difficult to remember, so I'll just use
Code:
void gtcha (char *stra)
or
void gtchb (char strb[])
3  Using Arduino / Programming Questions / Re: Problems with strings and &chars on: September 18, 2014, 04:36:33 pm
In the link near the end, there is a line:
string answer2;

In the example.
Code:
int main ()
{
  char question1[] = "What is your name? ";
  string question2 = "Where do you live? ";
  char answer1 [80];
  string answer2;
  cout << question1;
  cin >> answer1;
  cout << question2;
  cin >> answer2;
  cout << "Hello, " << answer1;
  cout << " from " << answer2 << "!\n";
  return 0;
But I can't find any more info about strings as variables. So it is probably an object or a function call.

But what is wrong with this
void gtcha (char &stra[])

4  Using Arduino / Programming Questions / Problems with strings and &chars on: September 18, 2014, 04:16:38 pm
It has been some time I last handled strings and I have forgotten this. Things which http://www.cplusplus.com/doc/tutorial/ntcs/ says should work, do not. It is a bit strange
I tried to pass a string or character array by value or reference, and I am getting errors where I think I should not get. Besides, what is wrong with using a string variable?


Code:
string str3 = "trtty ";  //This gives always an error "sketch_sep18b:5:
//error: 'string' does not name a type"
char str1[100]="fdfdfd";
char str2='l';
void setup()
{

  Serial.begin(9600);
}
void loop()
{
 gtcha (str1);

}
void gtcha (char &stra[]) //this does not work. The error "sketch_sep18b:5: error:
//declaration of 'stra' as array of references"
{
Serial.print(stra);   
}
void gtchb (char strb[]) //this does work
{
Serial.print(strb);   
}
5  Development / Other Software Development / Re: changing arduino name in serial device list on: August 26, 2014, 10:05:40 am
This is interesting, allthough I am not the original poster.

What do you gain if buy an USB ID from http://www.usb.org/home?
6  Using Arduino / General Electronics / Re: Electric shock with external supply on: August 26, 2014, 10:03:11 am
Stop using the adapter now. After that you can read the rest of this. There are many kinds of shocks. Some power supplies may leak a little, which is harmless, or they can be dangerous if they are for instance broken. Try to return your power supply and buy a new one. That is safest way.

It would be a miracle if some kind of Arduino Shield would give you electric shocks. Those that I know of, do not generate high enough voltages to give el. shocks.

It is possible that the power supply of your computer leaks a little electricity or is broken, but you would notice it without the adapter too. If you touch metal parts of your computer you may notice something, it depends what kind of mains plugs and cables you have.

EDIT: Fixed some typos.
7  Development / Other Software Development / Re: changing arduino name in serial device list on: August 23, 2014, 10:52:45 am
It is Windows/Arduino/AVR driver issue. I saw something about it here sometime ago. Like having your own USB drivers/ID.

But you can hack Arduino drivers. Check carefully every Arduino driver file. Then you just install/uninstall drivers until they work, perhaps do a system restore or two.
8  Development / Other Software Development / Re: Programming for newbies? on: August 23, 2014, 10:41:30 am
Well. I have done some write only software myself, too. Sometimes it happens overnight. I write something and the next day I have no idea what it is and why I did it . Database GUIs for instance.

Yes. I too have heard stories about awful Labview sw. But I still think that for simple things it is a good choice.
9  Development / Other Software Development / Re: Programming for newbies? on: August 20, 2014, 03:48:30 pm
It is difficult to recommend C(++) to someone who has newer really programmed and does not want to start now. But many people know about PLCs , relays and so on. They still hope to do some basic functions, like delays and comparisons. For those who need it using microprocessors should be as easy as it gets.
10  Development / Other Software Development / Re: Programming for newbies? on: August 19, 2014, 01:10:04 pm
Well
It looks like there are not many substitutes even for Windows. Pylabs is one I found. https://code.google.com/p/pylab-works/
Using Labview was like children's play. (That's what Windows is: Children's toys?)
And compare it to this:
Code:
template<class T, size_t N>
size_t array_length(T (&arr)[N])
{
    return N;
}
Above is a example from Net. I have idea what it does, except nightmares.
11  Development / Other Software Development / Programming for newbies? on: August 18, 2014, 04:55:10 pm
Is there some other languages than C++ available for Arduino? I personally can use C++ but people often ask for an easy way to program some simple things. And C++ for an absolute beginner is quite a lot, expecially if you want a delay or something like that.

Something like for instance Labview where you draw what you want.
12  Using Arduino / Project Guidance / Re: Sending a signal through a cable on: July 18, 2014, 06:44:15 pm
Yes, 5-6feet is not so long. A lot depends on the transfer speed you use. If you just wait everything to settle up or get stable, you can use very long cables. Don't forget the earth wire/wires. With high speed and long cables you get transmission lines.
13  Using Arduino / Project Guidance / Re: How to put a CTRL-z character to the serial monitor send-window? on: July 18, 2014, 06:32:28 pm
I just sent myself a SMS with Putty. Ctrl-Z in the putty window worked.
14  Using Arduino / Project Guidance / Re: How to put a CTRL-z character to the serial monitor send-window? on: July 18, 2014, 06:28:45 pm
I have to try that.
I got putty running and it looks nice.
15  Using Arduino / Project Guidance / Re: How to put a CTRL-z character to the serial monitor send-window? on: July 18, 2014, 06:13:23 pm
Yes, I guess I have to. I tried Realterm. It works but it messes up its display.
Pages: [1] 2 3 ... 16