Go Down

Topic: Two ideas (Read 4346 times) previous topic - next topic

Warwickben

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.



graynomad

Quote
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 :)

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
Rob Gray aka the GRAYnomad www.robgray.com

robtillaart

#2
May 02, 2011, 05:01 pm Last Edit: May 02, 2011, 05:02 pm by robtillaart Reason: 1

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 .... ;)

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

graynomad

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
Rob Gray aka the GRAYnomad www.robgray.com

Warwickben

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.

CrossRoads

Maybe you could have him check for = vs == while he's at it
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Warwickben

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.

CrossRoads

== 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;
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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:


Code: [Select]

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...

Warwickben

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

perhof

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.
http://codemirror.net/

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

keeper63


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:


Code: [Select]

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:

Code: [Select]

int foo;
if (foo = getSomeValue()) {
  int bar = doSomethingWithFoo(foo);
}
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

CrossRoads

I don't comprehend why one would assign a value as an If condition.
I'm missing the logic behind why that is useful.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tastewar

It would be much clearer to write:
Code: [Select]

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.

CrossRoads

What value of foo causes the if to not pass?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up