Jump to content

Search the Community

Showing results for tags 'sonestepattime'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 1 result

  1. Atom74

    Library stepper.h

    Hey guys, I´m using a stepper motor in half step mode. In half step my motor has 400 steps. I wanna make it move one step at time with short pauses between each movement (2,5s). Also, after it completes the 400 steps it should start moving on the opposite direction. I´m using the library stepper.h but I´m having some doubts about it, this is my code at the moment: #include <Stepper.h> int x = 1; // step int z = 0; int w = -1; const int stepsPerRevolution = 400; // number of steps in half step mode Stepper myStepper(stepsPerRevolution, 8,9,10,11); void setup() { myStepper.setSpeed(60); // 60 rpm } void loop() { myStepper.step(x); delay(2500); // pause between each step 2,5s x++; if(x==stepsPerRevolution) z=1; // when 400 steps then move in the opposite direction while(z){ myStepper.step(-w); delay(2500); w--; if(w==-stepsPerRevolution) z=0 && x=1; } } } I don´t know if it is configure correctly. Should I use stepsPerRevolution = 200 (number of steps in full step mode) with x increasing in 0.5 by time? Also, can I use myStepper.step that way? Thank you!
×
×
  • Create New...