Pages: 1 [2]   Go Down
Author Topic: What do you think?  (Read 497 times)
0 Members and 1 Guest are viewing this topic.
North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 69
Posts: 2165
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Download the IDE 1.5.7, then you can activate C++11, which will be active in 1.5.8 and above.

C++11 is mostly additions to C++98, there are only a handful of rules/keywords/features that have changed significantly ( auto for instance ). So just search for any C++ info, if you need C++11 its there for you to use.

Question 2, haven't read much of your topic, however a robot always needs lasers.

Logged


SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 132
Posts: 6739
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
is there any way to do the same thing [as the goto]

How about:
Code:
  case 's':  //s(stop) esetben ((:))
    while ( turndirection == 's') {

      Serial.println("Hatra tolatok majdszetnezek");
      ALLBACKWARD(200-Faradtsag);
      delay(700);
      ALLBACKWARD(200-Faradtsag);
      delay(700);
      ALLBRAKE(30);
      delay(20);

      char turndirection = scan();
      switch (turndirection)
      {

      case 'l':   //l(left) esetben ((:))

        Serial.println("Balra megyek");
        ALLLEFT(250-Faradtsag);
        delay(670);
        ALLBRAKE(30);
        break;

      case 'r':  //r(right) esetben ((:))

        Serial.println("Jobbra megyek");
        ALLRIGHT(250-Faradtsag);
        delay(670);
        ALLBRAKE(30);
        break;

      case 's':   //s(stop) esetben ((:))
        break;   // stay stopped by looping.
      } // inner switch
    } // while "stopped"

I don't quite understand what your code is doing (ALLBACKWARD for 700 ms doesn't seem like "stopped."), but I'm pretty sure that the program logic here accomplishes the same thing you did with your goto...
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 48993
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what version in c++ i should read about ?
C++ 98. It's the most commonly used software in the world.

Quote
i have an old All about c/c++ boob
Really? I find that rather ironic.  smiley-cool

Quote
but it is very different , its not like arduino programming
Yes, it is. You simply haven't recognized the similarities yet, or didn't understand the material.

Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26183
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
c/c++ boob
Is that slightly smaller than a D?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 1
Posts: 47
Long time web software developer and allround ICT specialist freaking with arduino.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not so much as an supportive comment on the coding style, but more so on the way lori3 handles this smiley-grin

12 years old, doing exactly what some of you asses accuse lori3 of needing to do .... learning and getting help, which is exactly what lori3  does in this thread.

Props little one,  your doing well and making progress, coming here and asking for help and judgement on your code is one of the foremost things to do next to looking it up in a book or on the web; seeking help from experienced programmers smiley

I would have totally flipped from some of the replies you got   smiley-sweat

*pokes AWOL*  ya crude bastard     smiley-evil

Code:
10 print "gw basic is for oldies"
20 goto 10

 smiley-roll-blue


I thought the world of gosub at some point in time   smiley-sad-blue
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26183
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I thought the world of gosub at some point in time
I can remember the first time "gosub" (or "GOSUB" as the teletype so shoutily rendered it) came up in a computer studies lesson.
It looked ludicrous - the example the teacher (who, to be fair, was probably only two pages ahead of the rest of us in the textbook) gave, made the program longer than (functionally) the same program without gosubs, and the entire class completely missed the point.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OMG !!! Thanks for help .... i didnt expected that ...  smiley

1. Thanks for PaulS for all the advice he gave..
2. Thanks to westf because he gave the most important thing..
  
 """"  I don't quite understand what your code is doing (ALLBACKWARD for 700 ms doesn't seem like "stopped."), but I'm pretty sure    that the program logic here accomplishes the same thing you did with your goto..."""
-- I didn't understood why you said "stopped" whit ""  but the Backward command inverses the rotate direction.. the BREAK command is for stopping the Forward rotates it normally and the release i don t know what is doing ... in fact it didn't worked but the idea whit while command saved me  smiley-wink

there are 2 kind o commands for PWM s:   motor(2, FORWARD, 255)-- who s from internet and rotates only 1 motor
                                                                                   ALLFORWARD(255) -- what is created by me and rotates all 2 motors
                                                                                
3.for pYro_65 for saying me what version c++ i need
4.and for Lennaert because he taked my side.

About the book (boob smiley ) is from 1997 by Kris Jamsa and Lars Klander for Borland Turbo C++ Lite ... Ahh and i read it like a story book but i m at only 10 percent of it because it had 1200 pg es

I will post my program if its ready...
« Last Edit: August 07, 2014, 11:37:17 am by lori3 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Its ready i v not tried it yet because my battery is too low but i think its OK .. I v modified  it 2 days because i created a more complex "detect and decide " program. I also changed the if s from the Serial Monitor Hotkeys to case s .

 I don t know why i have an impression that this is a little bit more dezorganizated. I will reformat it (manually because i tried it whit auto format and it s worse than now)  tomorrow and re post it...

* Alap.ino (42.55 KB - downloaded 4 times.)
« Last Edit: August 08, 2014, 10:18:31 am by lori3 » Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9541
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well, come back when you've evolved into a life-form which does.

Pitiful! Sad that some things don't change, and from a "moderator" too.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26183
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well, come back when you've evolved into a life-form which does.

Pitiful! Sad that some things don't change, and from a "moderator" too.


Pitiful that some users are so paranoid that they imagine you have to surrender your sense of humour (if they ever had one) just to take up a nominated volunteer post (which, by the way,  doesn't require quotation marks) on a hobby forum.
« Last Edit: August 09, 2014, 09:32:05 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: 1 [2]   Go Up
Jump to: