I am a new entery in the forum , i need some help for build a VB code for
Up / Down counter ( with debounce ) using digital input #1 ( Up train pulse )
and input #2 ( Down train pulse ) , the Sw counter increase or decrease a counter
and the result is send out to PWM
Finally I have to drive 0 to 5Vdc analog driver according to the manual direction
of the encoder ( Channel A and B pulse train is just decoded according to the manual
turn of the encoder )
In this thread there is an example VB code how to create a pulse counter with debounce: viewtopic.php?f=15&t=8888
With minor modifications you can create the down counter for digital input #2.
You need two more global variables for digital input #2.
For example:Dim LastStableState_2 As Boolean
Dim TimerEvents_2 As Integer
You can use the VB demo program in the folder \Examples\VM167DemoVB_2008 as a starting point.
Add there the second timer ‘Timer2’ and test its operation with some code.
When OK, paste the pulse counter code to the event handler of this timer.
It seems you have not created the Timer2 on the Form.
In the Tools menu locate the Timer and double it to get new timer on the screen.
Then double click on the new Timer at the bottom and add the code into its event handler.
Please do not copy the first line starting with ‘Private Sub …’ to your program.
Copy only the content.
I am building a dashboard for my electric powered motorglider ( is not a scale but is real PW5 )
finally i have to integrate your board in one ACCESS application for diplay battery , motor and BMS unit ( 3 pack of 7s3p LiFep04 76Volt / 300A continue a 20kw BLDC motor BMS and so on ,