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
Ad icon
Video Content Creator
pramukag
Updated:
Yesterday at 6:10 AM
Ad icon
QA Engineer Intern
pramukag
Updated:
Yesterday at 6:07 AM
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Thursday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Jun 21, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Arduino serial communication 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="_A_I_I_" data-source="post: 20805814" data-attributes="member: 499503"><p>මේකේ arduino එක මොකටවත් connect කරලා නෑ නේද. එහෙමනම් serial.write කරලා ඒක serial.read කලාට හරියන්නේ නෑ. serial.write එකෙන් TX buffer එකට write වෙන්නේ. serial.read() එකෙන් RX buffer එකෙන් read වෙන්නේ. මට පේන විදිහට Serial එක ඕනේ නෑ. key එක read කරන char එක use කලාම ඇති.</p><p>[CODE]</p><p>#include <Keypad.h></p><p></p><p>const byte ROWS = 4;</p><p>const byte COLS = 3;</p><p>char keys[ROWS][COLS] = {</p><p> {'1','2','3'},</p><p> {'4','5','6'},</p><p> {'7','8','9'},</p><p> {'#','0','*'}</p><p>};</p><p>byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad</p><p>byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad</p><p></p><p>Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );</p><p></p><p>void setup(){</p><p> </p><p>}</p><p></p><p>void loop(){</p><p> char key = keypad.getKey();</p><p></p><p> if(key){</p><p> if(key=='1'){</p><p> digitalWrite(10,HIGH); //led light up</p><p> }else{</p><p> digitalWrite(10,LOW);</p><p> }</p><p> }</p><p>}</p><p></p><p></p><p></p><p></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="_A_I_I_, post: 20805814, member: 499503"] මේකේ arduino එක මොකටවත් connect කරලා නෑ නේද. එහෙමනම් serial.write කරලා ඒක serial.read කලාට හරියන්නේ නෑ. serial.write එකෙන් TX buffer එකට write වෙන්නේ. serial.read() එකෙන් RX buffer එකෙන් read වෙන්නේ. මට පේන විදිහට Serial එක ඕනේ නෑ. key එක read කරන char එක use කලාම ඇති. [CODE] #include <Keypad.h> const byte ROWS = 4; const byte COLS = 3; char keys[ROWS][COLS] = { {'1','2','3'}, {'4','5','6'}, {'7','8','9'}, {'#','0','*'} }; byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ } void loop(){ char key = keypad.getKey(); if(key){ if(key=='1'){ digitalWrite(10,HIGH); //led light up }else{ digitalWrite(10,LOW); } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Hath warak paha keeyada? (hatha wadikireema paha)
Post reply
Top
Bottom