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
Puffin Rock Characters Plush Toy Set
anil1961
Updated:
Today at 3:51 PM
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Wednesday at 10:50 AM
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Monday at 12:26 PM
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Sunday at 12:41 PM
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 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="apikaluda?" data-source="post: 24120902" data-attributes="member: 470863"><p><span style="font-size: 15px"><span style="color: Blue">Machan issellama buttons thuna balanna wei wage weda karana widiha awulda kiyala...ekata me code eka use karanna....</span></span></p><p><span style="font-size: 15px"><span style="color: Blue">Stepper eke okkoma one nam galawala ain karanna (reccommended). Code eke wisthara daala tiyenawa karana widihai balanna ona dewalui...e tika balala reply eka denna...apita meka iseella karala balanna thibbe...awulak ne den balamu.... </span></span></p><p><span style="font-size: 15px"><span style="color: Blue"></span></span></p><p><span style="font-size: 15px"><span style="color: Blue"></span></span></p><p><span style="font-size: 15px"><span style="color: Blue"></span></span></p><p></p><p></p><p><span style="font-size: 12px">// Code is to check the correct operating conditions of the three buttons</span></p><p><span style="font-size: 12px">// ******REMOVE ALL CONNECTION TO STEPPER AND CONNECT ONLY THE PUSH BTN, 2 LIMIT SWITCHES*******</span></p><p><span style="font-size: 12px">//</span></p><p><span style="font-size: 12px">// connections are to be done as follows:</span></p><p><span style="font-size: 12px">// PUSH BUTTON > PIN 6</span></p><p><span style="font-size: 12px">// FORWARD LS > PIN 2</span></p><p><span style="font-size: 12px">// REVERSE LS > PIN 7</span></p><p><span style="font-size: 12px">//</span></p><p><span style="font-size: 12px">// THEN:</span></p><p><span style="font-size: 12px">// check for the following conditions using Serial Monitor</span></p><p><span style="font-size: 12px">//1) push only push button and check the states of all three buttons </span></p><p><span style="font-size: 12px">//2) push only Forward LS and check the states of all three buttons</span></p><p><span style="font-size: 12px">//3) push only Reverse LS and check the states of all three buttons </span></p><p><span style="font-size: 12px">//4) push (push button + Forward LS) and check the states of all three buttons</span></p><p><span style="font-size: 12px">//5) push (push button + Reverse LS) and check the states of all three buttons</span></p><p><span style="font-size: 12px">//6) push (Forward LS + Reverse LS) and check the states of all three buttons</span></p><p><span style="font-size: 12px">//7) push (push button + Forward LS + Reverse LS) and check the states of all three buttons</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">//==========================================================================================</span></p><p><span style="font-size: 12px">const int ForwardLimitSwitchPin = 2; //forward LS pin</span></p><p><span style="font-size: 12px">const int ReverseLimitSwitchPin = 7; // reverse LS pin</span></p><p><span style="font-size: 12px">const int buttonPin = 6; // the number of the pushbutton pin (choose the correct pin here)</span></p><p><span style="font-size: 12px"></span></p><p> <span style="font-size: 12px"></span></p><p><span style="font-size: 12px">void setup() {</span></p><p><span style="font-size: 12px"> pinMode(ForwardLimitSwitchPin, INPUT_PULLUP); //declare two LS as inputs</span></p><p><span style="font-size: 12px"> pinMode(ReverseLimitSwitchPin, INPUT_PULLUP); </span></p><p><span style="font-size: 12px"> pinMode(buttonPin, INPUT); //declare push button signal as an input</span></p><p><span style="font-size: 12px"> Serial.begin(9600); //Serial Monitoring ON</span></p><p><span style="font-size: 12px"> Serial.println("Push button state\t\tForward LS State\t\tReverse LS State");</span></p><p><span style="font-size: 12px">}</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">void loop() { </span></p><p><span style="font-size: 12px"> Serial.print(digitalRead(buttonPin);</span></p><p><span style="font-size: 12px"> Serial.print("\t\t\t\t\t\t\t\t");</span></p><p><span style="font-size: 12px"> Serial.print(digitalRead(ForwardLimitSwitchPin));</span></p><p><span style="font-size: 12px"> Serial.print("\t\t\t\t\t\t\t\t"); </span></p><p><span style="font-size: 12px"> Serial.println(digitalRead(ReverseLimitSwitchPin)); </span></p><p><span style="font-size: 12px">} </span></p><p><span style="font-size: 12px">//==========================================================================================</span></p><p><span style="font-size: 12px"></span></p></blockquote><p></p>
[QUOTE="apikaluda?, post: 24120902, member: 470863"] [SIZE=4][COLOR=Blue]Machan issellama buttons thuna balanna wei wage weda karana widiha awulda kiyala...ekata me code eka use karanna....[/COLOR][/SIZE] [SIZE=4][COLOR=Blue]Stepper eke okkoma one nam galawala ain karanna (reccommended). Code eke wisthara daala tiyenawa karana widihai balanna ona dewalui...e tika balala reply eka denna...apita meka iseella karala balanna thibbe...awulak ne den balamu.... [/COLOR][/SIZE] [SIZE=4][COLOR=Blue] [/COLOR][/SIZE] [SIZE=3]// Code is to check the correct operating conditions of the three buttons[/SIZE] [SIZE=3]// ******REMOVE ALL CONNECTION TO STEPPER AND CONNECT ONLY THE PUSH BTN, 2 LIMIT SWITCHES******* // // connections are to be done as follows: // PUSH BUTTON > PIN 6 // FORWARD LS > PIN 2 // REVERSE LS > PIN 7 // // THEN: // check for the following conditions using Serial Monitor //1) push only push button and check the states of all three buttons //2) push only Forward LS and check the states of all three buttons //3) push only Reverse LS and check the states of all three buttons //4) push (push button + Forward LS) and check the states of all three buttons //5) push (push button + Reverse LS) and check the states of all three buttons //6) push (Forward LS + Reverse LS) and check the states of all three buttons //7) push (push button + Forward LS + Reverse LS) and check the states of all three buttons //========================================================================================== const int ForwardLimitSwitchPin = 2; //forward LS pin const int ReverseLimitSwitchPin = 7; // reverse LS pin const int buttonPin = 6; // the number of the pushbutton pin (choose the correct pin here) void setup() { pinMode(ForwardLimitSwitchPin, INPUT_PULLUP); //declare two LS as inputs pinMode(ReverseLimitSwitchPin, INPUT_PULLUP); pinMode(buttonPin, INPUT); //declare push button signal as an input Serial.begin(9600); //Serial Monitoring ON Serial.println("Push button state\t\tForward LS State\t\tReverse LS State"); } void loop() { Serial.print(digitalRead(buttonPin); Serial.print("\t\t\t\t\t\t\t\t"); Serial.print(digitalRead(ForwardLimitSwitchPin)); Serial.print("\t\t\t\t\t\t\t\t"); Serial.println(digitalRead(ReverseLimitSwitchPin)); } //========================================================================================== [/SIZE] [/QUOTE]
Insert quotes…
Verification
Hath warak paha keeyada? (hatha wadikireema paha)
Post reply
Top
Bottom