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
Cinnamoroll Soft Toy – Cute & Cuddly Plush
anil1961
Updated:
Today at 4:59 AM
Google Pixel 9 Pro
vgp
Updated:
Thursday at 5:57 PM
Ad icon
Jobreceive.com for sale
Blogerwiki
Updated:
Tuesday at 8:55 PM
Post Your Vehicle for Sale — FREE! - https://libro.lk
Kalu_Puth
Updated:
Tuesday at 7:38 PM
ඔයාගෙ Assignment හෝ Thesis එක හරියට හදාගමු
ErMurazor
Updated:
Sep 26, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
Python වලින් rfid card එකක data කියවන්න
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="EKGuest" data-source="post: 29658990" data-attributes="member: 582168"><p>ඒකට කරන්න තියෙන්නේ එකම කාඩ් එක ආයෙත් කියවන්න ඕනේ වෙලාවට මොකක් හරි කී එකක් ප්රෙස් කලාම last_id එක රීසෙට් කරන්න. පහලින් දාපු කෝඩ් එකේ R අකුර press කලාම last_id එක රීසෙට් වෙනවා. එතකොට එකම කාඩ් එක ආයේ කියවන්න පුලුවන්. පයිතන් keyboard module එක install කරලා ඉන්න.</p><p></p><p>[CODE=python]#!/usr/bin/env python</p><p></p><p>import time</p><p>import RPi.GPIO as GPIO</p><p>from mfrc522 import SimpleMFRC522</p><p>import requests</p><p>import keyboard</p><p></p><p>reader = SimpleMFRC522()</p><p></p><p>try:</p><p> pressed_key_r = False</p><p> last_id = -1</p><p> while True:</p><p> id, text = reader.read()</p><p> if id != last_id:</p><p> print(id)</p><p> print(text)</p><p> # call the webservice and post data</p><p> #......</p><p> #</p><p> print('Waiting for next card to read...')</p><p> print('--')</p><p> last_id = id</p><p> if keyboard.is_pressed('r'):</p><p> if not pressed_key_r:</p><p> last_id = -1</p><p> pressed_key_r = True</p><p> else:</p><p> pressed_key_r = False</p><p>finally:</p><p> GPIO.cleanup()[/CODE]</p></blockquote><p></p>
[QUOTE="EKGuest, post: 29658990, member: 582168"] ඒකට කරන්න තියෙන්නේ එකම කාඩ් එක ආයෙත් කියවන්න ඕනේ වෙලාවට මොකක් හරි කී එකක් ප්රෙස් කලාම last_id එක රීසෙට් කරන්න. පහලින් දාපු කෝඩ් එකේ R අකුර press කලාම last_id එක රීසෙට් වෙනවා. එතකොට එකම කාඩ් එක ආයේ කියවන්න පුලුවන්. පයිතන් keyboard module එක install කරලා ඉන්න. [CODE=python]#!/usr/bin/env python import time import RPi.GPIO as GPIO from mfrc522 import SimpleMFRC522 import requests import keyboard reader = SimpleMFRC522() try: pressed_key_r = False last_id = -1 while True: id, text = reader.read() if id != last_id: print(id) print(text) # call the webservice and post data #...... # print('Waiting for next card to read...') print('--') last_id = id if keyboard.is_pressed('r'): if not pressed_key_r: last_id = -1 pressed_key_r = True else: pressed_key_r = False finally: GPIO.cleanup()[/CODE] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom