Notifications
Clear all

Function arguments

79 Posts
8 Users
12 Likes
2,703 Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 
Posted by: @frogandtoad

@barrie

 for (byte gpio = Rled; gpio == Wled; gpio++) {
    pinMode(gpio, OUTPUT);
   }

Did you mean gpio<=Wled ?

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will

I am currently looking at drop box. Never used it but I believe I will be able to get a URL.

This post was modified 2 years ago by barrie

   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@barrie 

Sounds good

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  
This post was modified 2 years ago by barrie

   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@barrie 

Your problem is that the runToPosition causes each stepper to complete that operation before moving on to do anything else. Change it to ...

void yoyo(int segment) {
  long target = FullStepsPerRev / segment;
  stepper1.setCurrentPosition(0);
  stepper2.setCurrentPosition(0);
  stepper1.moveTo(target);
  stepper2.moveTo(-target);
  while (stepper1.distanceToGo()>0) {
    stepper1.run();
    stepper2.run();
  }
}

 

This will allow each stepper to step once inside the while loop and will appear to "share" the motion.

 

Anything seems possible when you don't know what you're talking about.


   
Ron and ron bentley reacted
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will Thank you, that looked promising but there was no reaction. The steppers didn't blink and kept running. 

By the way, did the video link work OK? Its my first use of the dropBox.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@barrie 

Maybe change >0 to !=0 ? Very curious.

Dropbox says that it can't preview items with no datatype, so you have to download the object and then guess at it's type, rename it and then play it.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@inq Good advice, thanks. In your absence I posted a cleaned up version of my sketch along with a link to a video showing the latest problem. 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 
Posted by: @barrie

The steppers didn't blink and kept running.

Blinking steppers ? What ?

What do you mean they "kept running", I thought you said the problem was that one or the other would stop ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will Sorry. I assumed you had seen the video. I am fixing it. I will send another link so you will have a better perspective.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6969
 

@barrie Try shooting the video in 640x480, NOT HighDef

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@barrie 

So you're saying that replacing your entire module you with my entire module made no difference at all in execution ?

Did it not compile or reload properly ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@zander  First time video on iPhone. Options are 4K or HD each each with 24 or 30 or 60 options. What is 4K 24? 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6969
 

@barrie 4K 24 is 4K resolution at 24frames per second (movie standard) You need to drop the 4K down to something a lot smaller, 1028 might fit in 10Meg but there is no need for a hollywood blockbuster, just a simple VGA 640x480 will suffice

You will probably have to run the raw video thru a downsizer.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 3 / 6