Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

PULSEIN_ARDUINO UNO
Goto page Previous  1, 2
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO
View previous topic :: View next topic  
Author Message
Printpix52

Bascom Member



Joined: 18 Jun 2014
Posts: 282
Location: D.F.

mexico.gif
PostPosted: Thu May 28, 2020 8:19 pm    Post subject: Reply with quote

Hola O_Family

So it works 100% well

When you increase the value, you will get a shorter timeout period.

Code:
Const Cpulsein_timeout = 5  


Pulsin reads every 10Us therefore it must be multiplied by 10

152 pulsin x 10 Us = 152 x10 = 1520 Us / 1000 = 1.52ms

With ARDUINO card I have tried them and it works well.
Now we know the values and ready to play with the project.

Code:
$regfile = "m328pdef.dat"
$crystal = 16000000
$hwstack=40
$swstack=16
$framesize = 32

$lib "pulsein.lib"
Const Cpulsein_timeout = 5
'Dim Bpulsein_delay As Byte
Const Bpulsein_delay = 10


Config Pind.2 = Input
Ddrd.2 = 1


Config Lcdpin = Pin , E = Portc.1 , Rs = Portc.0
Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3
Config Lcdpin = Pin , Db6 = Portc.4 , Db7 = Portc.5
Config Lcdbus = 4
Config Lcd = 16x2
Cls
Cursor Off


Dim W As Word


 Locate 1 , 1
 Lcd "PROBADOR DE RC"
 Waitms 100


Do
   Bitwait Pind.2 , Reset
   Pulsein W , Pind , 2 , 1
   Locate 2 , 1
   Lcd "PULSO ES " ; W ; "    "
Loop
End


I will study a little more.
Thanks friend!!! Very Happy Very Happy Very Happy Very Happy

[img][/img]
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum