|
-
Aug 30th, 2007, 12:19 PM
#1
Thread Starter
New Member
Re: Help: How to control DC Motor using VB Expres 2005
im using ldr to sense the revolution of the motor per minute or per second, pls help im a beginner and still don't know how to program well.
my program is not working
dim x as integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Inp(889)
X = X + 1
End Sub
End Sub
-
Aug 30th, 2007, 12:38 PM
#2
Thread Starter
New Member
Re: Help: How to control DC Motor using VB Expres 2005
to be more easier for us both, and not to be unfair for others like what you have said a while ago, lets make the code easier. lets say i have a button tool.
by clicking the button how will i compute and display the no of times i clicked it per minute?
Last edited by shounenbat; Aug 30th, 2007 at 12:50 PM.
-
Aug 30th, 2007, 02:17 PM
#3
Re: Help: How to control DC Motor using VB Expres 2005
There are a couple of ways you could work out RPM:
1. Count pulses and test the count after a set period of time, eg. 1 second.
2. Detect how much time passes between pulses.
I would suggest that option number 1 will be easier.
Take your input and increment a counter with each pulse you get.
On each timer tick, read the counter value and multiply it by 60. This will give you RPM assuming a tick frequency of 1 second, and also assuming you have one pulse per revolution of your motor. After you have calculated a result for that tick, reset your counter variable.
Really though, that's mostly just basic maths.
How you read in the input from the sensor, I have no idea, but I assume you already know that, or it forms part of the study material for you project.
As has been mentioned, I don't think anyone will write out a whole load of code for you, but that should give you a nudge in the right direction.
-
Aug 30th, 2007, 02:49 PM
#4
Thread Starter
New Member
Re: Help: How to control DC Motor using VB Expres 2005
tanx Andy_P i'll try to work on it.
-
Aug 31st, 2007, 12:52 AM
#5
Thread Starter
New Member
Re: Help: How to control DC Motor using VB Expres 2005
Public X As Integer
Public y As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Interval = 1000
X = (X + 1)
Label1.Text = X ' this show the timer tick every sec
label2.text=inp(889) 'signal coming from my ldr
you have said that the count of my signal should be multiplied by 60, then should i declare an integer to show the rpm??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|