Announcement

Collapse
No announcement yet.

Is there a simple way to do this?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a simple way to do this?

    Hi,

    I am writing a test program for autonomous. I was planning on doing encoders for specific distance but I don't think I will be able to do it now. So I am using time for it now. Is there a way to make the following code simpler?
    https://goo.gl/photos/XNwHESVM3CUtXts77
    Thanks,
    Programmer - FTC Delta Kappa

  • #2
    Why are you checking if the time is greater than or equal 0? I don't think it's possible to have negative time.

    Comment


    • #3
      I agree with FTC4160. You can make it simpler by just testing if time ≤ 3.

      Comment


      • #4
        Originally posted by FTC4160 View Post
        Why are you checking if the time is greater than or equal 0? I don't think it's possible to have negative time.
        You are right but that will be just for the first part. For the ongoing further parts, I would have to say like that, right? I mean after 3 seconds, I have to turn left for 0.5 seconds. So I will have to say, if time is greater than 3 and and less than 3.5, right? So is there a better way to do it
        Thanks,
        Programmer - FTC Delta Kappa

        Comment

        Working...
        X