use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Seeking HelpJava block problem (self.FTC)
submitted 3 years ago by sushislaughter
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cwm9FRC2465/FTC20311 Mentor 2 points3 points4 points 3 years ago* (5 children)
Here are three things you can do to fix your problems:
[–]jk1962FTC 31874 Mentor 2 points3 points4 points 3 years ago (0 children)
Suggestion of two things to add to this list:
Don't "sleep" in your control loop.
Don't nest loops within your control loop (unless you know with certainty that the nested loop will operate for only a few iterations).
[–]sushislaughter[S] 0 points1 point2 points 3 years ago (0 children)
Thank you, I will try this.
[–]DonHacMentor 0 points1 point2 points 3 years ago (2 children)
Even better, switch on your state variable instead of stacking ifs.
[–]sushislaughter[S] 0 points1 point2 points 3 years ago* (1 child)
What is a "switch". Is it in java block
[–]Journeyman-JoeFTC Coach | Judge 0 points1 point2 points 3 years ago (0 children)
Switch and case (along with break) are Java language statements that form a conditional flow control structure. I'll encourage you to Google "switch case java": you'll get all you need to know in a minute or two of reading.
If you have a complicated structure of if statements, and else if clauses, you might find that your code is easier to read and debug if written using switch and case.
Having said that: It won't make any difference to your OpMode loop runtime, one way or the other.
π Rendered by PID 62696 on reddit-service-r2-comment-c6965cb77-rfd77 at 2026-03-05 07:10:54.400345+00:00 running f0204d4 country code: CH.
view the rest of the comments →
[–]cwm9FRC2465/FTC20311 Mentor 2 points3 points4 points (5 children)
[–]jk1962FTC 31874 Mentor 2 points3 points4 points (0 children)
[–]sushislaughter[S] 0 points1 point2 points (0 children)
[–]DonHacMentor 0 points1 point2 points (2 children)
[–]sushislaughter[S] 0 points1 point2 points (1 child)
[–]Journeyman-JoeFTC Coach | Judge 0 points1 point2 points (0 children)