Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Handmade Character Soft Toys
anil1961
Updated:
6 minutes ago
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Jun 11, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Arduino help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="dushan90" data-source="post: 24120546" data-attributes="member: 74595"><p>Machan circuit eke aulak nan</p><p></p><p></p><p>[CODE]#include<Stepper.h></p><p></p><p>const int StepperStepPin = 4;</p><p>const int StepperDirectionPin = 5;</p><p>const int StepperMaxRPM = 900;</p><p>const int ForwardLimitSwitchPin = 2;</p><p>const int ReverseLimitSwitchPin = 7;</p><p>const int LimitSwitchActivated = LOW;</p><p></p><p>Stepper stepper(200, StepperStepPin, StepperDirectionPin);</p><p></p><p>void setup() {</p><p> pinMode(ForwardLimitSwitchPin, INPUT_PULLUP);</p><p> pinMode(ReverseLimitSwitchPin, INPUT_PULLUP);</p><p> stepper.setSpeed(StepperMaxRPM);</p><p> </p><p> </p><p>}</p><p></p><p>void loop() {</p><p> // Step forward until the limit switch is activated</p><p> while (digitalRead(ForwardLimitSwitchPin) != LimitSwitchActivated) {</p><p> stepper.step(1);</p><p> }</p><p> // Step reverse until the limit switch is activated</p><p> while (digitalRead(ReverseLimitSwitchPin) != LimitSwitchActivated) {</p><p> stepper.step(-1);</p><p> }</p><p>}[/CODE]</p><p></p><p></p><p>Meka aulak nathuwa wada karanna vidihak na neda?</p></blockquote><p></p>
[QUOTE="dushan90, post: 24120546, member: 74595"] Machan circuit eke aulak nan [CODE]#include<Stepper.h> const int StepperStepPin = 4; const int StepperDirectionPin = 5; const int StepperMaxRPM = 900; const int ForwardLimitSwitchPin = 2; const int ReverseLimitSwitchPin = 7; const int LimitSwitchActivated = LOW; Stepper stepper(200, StepperStepPin, StepperDirectionPin); void setup() { pinMode(ForwardLimitSwitchPin, INPUT_PULLUP); pinMode(ReverseLimitSwitchPin, INPUT_PULLUP); stepper.setSpeed(StepperMaxRPM); } void loop() { // Step forward until the limit switch is activated while (digitalRead(ForwardLimitSwitchPin) != LimitSwitchActivated) { stepper.step(1); } // Step reverse until the limit switch is activated while (digitalRead(ReverseLimitSwitchPin) != LimitSwitchActivated) { stepper.step(-1); } }[/CODE] Meka aulak nathuwa wada karanna vidihak na neda? [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom