Two ideas

Me and one of my friends where talkin and figured it could be useful to have a arduino IDE for iPhone,pad,touch,android. That way you code write code when ur on the bus, plane etc.
Wouldn't have to be able to up load it to the arduino board but that would be awesome if it could.
Would make my life alot easier to cause my work shop dosent have my Mac in it and I don't have a laptop.

It would more or less be A note pad app,but not sure how to say this( would format like the the normal IDE) certin word turn yellow blue etc. That way ur code tell if u typed it right. Maybe have a way to check it for errors. My buddy said if he got a list of all the words that change color etc he could do that part of it. Be able to save said code and email it.

My other idea is to have shortcuts add to the IDE . Like u holt alt and press pm sut type pinmode stuff like that so u would have to type so much.

Let me know what u guys think.

u holt alt and press pm sut type pinmode stuff like that so u would have to type so much.

I can see you don't like to type any more than absolutely necessary, trouble it makes a sentence unreadable :slight_smile:

Apart from that, you can still write code on anything with a text editor although I can see a benefit to being able to verify the code by compiling. Trouble is that means getting GCC to run on these platforms, has it been ported to them?


Rob

I think adding the compiler is not necessary (on contrary), the next thing asked for is a Arduino Simulator for Android, IOS etc

From my own experience I know that not having a compiler (few hours a day) gives the highest added value. It makes me focus on the overall structure of a program to get the semantics right. It makes me think, think and think all things over again. Rewrite datatypes and optimize algorithms, think about the maintainability and comments.

Having a compiler just makes me focus on getting the syntax right (making the compiler happy), and there are times thats important but definitely not allways.

-- edit --

maybe you wouldn't had these two ideas when you had a compiler nearby all day .... :wink:

Yes that's a valid point. We used to spend days or even weeks designing and prototyping software before a single line was compiled.


Rob

Sorry about spelling etc I was running around etc.

I'm gonna force my buddy to write a app for the iPhone/iPad so you can just code on the go.
And it will color code like the IDE. So u know you wrote LOW/HIGh not low/high.and have short cuts for certin bits of code so u don't allways have to type it out.
He told me it shouldn't be hard to do and would be easy to port to google phones.

I figure when I'm at lunch etc I can work on coding why I thought of this.

Maybe you could have him check for = vs == while he's at it

You u guys wanna help make lists that would help.

Like I'm still learning coding my self. If I remember right . You should never have just (=)right it should be == so I could have him make it so (=) is red.

== is good if you are testing for a value. Ex. Does variable x equal 6?
if (x == 6) {do something;}

= is good if you are setting a value. Ex. Set x equal to 6.
x = 6;

In c/c++, a single = is assignment; a double is comparison. They are both necessary, but a common coding error is to use one when two is meant, and this produces unintended results:

joe=0;
if ( joe=1 ) DoSomething();

will assign the value 1 to joe, and we will DoSomething() though we probably didn't intend to. We probably intended to compare joe to 1 and not do something. You can see how this would be a common type of bug...

Yeah I see what is possible for color coding . Figure well make one then just update as we go.

Tried any of the online editors in your mobile browser?

There used to be one called Bespin/Mozilla Skywriter that I heard was supposed to have Arduino highlighting.
They have now merged with ACE editor which doesn't mention Arduino anymore but Cloud9ide.com is based on the ACE Editor and the Cloud9ide guys says they are working on a native smartphone client. Could that be worth looking in to?

You could also try if Codemirror 2 works in your browser. They have online demo's and if they work, just add an Arduino mode to it. It seems quite easy.

Unless your friend really is up to developing a native Arduino editor because that would of course beat all that...

tastewar:
In c/c++, a single = is assignment; a double is comparison. They are both necessary, but a common coding error is to use one when two is meant, and this produces unintended results:

joe=0;

if ( joe=1 ) DoSomething();




will assign the value 1 to joe, and we will DoSomething() though we probably didn't intend to. We probably intended to compare joe to 1 and not do something. You can see how this would be a common type of bug...

But it can be useful - so how would you know when it is a bug and when it isn't? For instance:

int foo;
if (foo = getSomeValue()) {
  int bar = doSomethingWithFoo(foo);
}

I don't comprehend why one would assign a value as an If condition.
I'm missing the logic behind why that is useful.

It would be much clearer to write:

int foo = getSomeValue();
if (foo) {
  int bar = doSomethingWithFoo(foo);
}

Code readability and maintainability are super-important. Sometimes you can argue that performance takes precedence, but there's no performance gain from putting the assignment in the if.

What value of foo causes the if to not pass?

0, I believe... ?

Or am I not understanding your question?

Or was it not directed at me? :slight_smile:

int foo;

if (foo = getSomeValue()) {
  int bar = doSomethingWithFoo(foo);
}

What that is doing is basically this:

int foo = getSomeValue();

if (foo) {
  int bar = doSomethingWithFoo(foo);
}

It's checking to see if foo is true (not false, false = 0).
So it's deciding if foo = getsomevalue() ,which can be said is just foo (as you're simply telling it what foo is), is true.

It's annoying to debug and normally people mean to use == in those situations so generally you wouldn't use that 'shortened version' for anything.

I'm gonna force my buddy to write a app

Maybe you could coerce him/her to include a grammar and spelling checker.