Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:10 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM update to 4.5, now output error

     Page 2 of 2    
Author Message
Tendor
Newbie

Joined: 14/12/2017
Location: Australia
Posts: 6
Posted: 05:11am 11 Mar 2018
Copy link to clipboard 
Print this post

Thanks Geoff!

I have loaded V4.5C (Mono) and tested my code that contains the 'port' command.
All appears to be working fine.
Sincere thanks for taking the time to fix this.

Here is my stepper motor drive code that now works on V4.5C (lost the indenting?)

Regards,
Rod.

'''''''''''''''''''''''''
LSBpin=13: bits=4
wait=5 'mS
out=&B0110: operate=&B0011
fwd=0:rev=1:direct=fwd

For i=LSBpin To LSBpin+bits-1
SetPin i,dout
Next

stepper 400,fwd,wait
End

Sub stepper(how_many,direction,delay)
Local i
If direct<>direction Then
operate=operate Xor &B1111
direct=Not(direct)
EndIf
For i=1 To how_many
out=out Xor operate
operate=operate Xor &B1111
Port(LSBpin,bits)=out
Pause delay
Next
End Sub


Edited by Tendor 2018-03-12
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 01:44pm 11 Mar 2018
Copy link to clipboard 
Print this post

Great news, thanks. I will post it on my website.

To post code use the CODE button at the top on the 'Post Reply' window. It retains indenting, spaces, special characters, etc.

Geoff
Geoff Graham - http://geoffg.net
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025