Formatting post:try2

kfjl

Member
Without code tags:
let PinsB = %10000000 'B.4 Energised B.7?
pause w2

let PinsB = %11000000 'B.4,B.5 Energised B.7,B.6?
pause w2

let PinsB = %01000000 'B.5 Energised B.6?
pause w2

let PinsB = %01100000 'B.5,B.6 Energised
pause w2

let PinsB = %00100000 'B.6 Energised B.5?
pause w2

let PinsB = %00110000 'B.6,B.7 Energised B.4, B.5?
pause w2

let PinsB = %00010000 'B.7 Energised B.4?
pause w2

let PinsB = %10010000 'B.7,B.4 Energised
pause w2

You can get by without the "Pins" command with something like this:

#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
; 1 1
; 0 1
; 0 0
; 1 0

b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main

avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main

arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main


Code:
let PinsB = %10000000 'B.4 Energised B.7?
pause w2

let PinsB = %11000000 'B.4,B.5 Energised B.7,B.6?
pause w2

let PinsB = %01000000 'B.5 Energised B.6?
pause w2

let PinsB = %01100000 'B.5,B.6 Energised
pause w2

let PinsB = %00100000 'B.6 Energised B.5?
pause w2

let PinsB = %00110000 'B.6,B.7 Energised B.4, B.5?
pause w2

let PinsB = %00010000 'B.7 Energised B.4?
pause w2

let PinsB = %10010000 'B.7,B.4 Energised
pause w2

You can get by without the "Pins" command with something like this:

#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
; 1 1
; 0 1
; 0 0
; 1 0

b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main

avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main

arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main
 

kfjl

Member
Another go:
Code:
   let PinsB = %11000000  'B.4,B.5 Energised          B.7,B.6?
     pause w2

     let PinsB = %01000000  'B.5     Energised          B.6?
   pause w2

   let PinsB = %01100000  'B.5,B.6 Energised
     pause w2

     let PinsB = %00100000  'B.6     Energised          B.5?
     pause w2

   let PinsB = %00110000  'B.6,B.7 Energised          B.4, B.5?
     pause w2

     let PinsB = %00010000  'B.7     Energised           B.4?
     pause w2

   let PinsB = %10010000  'B.7,B.4 Energised
     pause w2

You can get by without the "Pins" command with something like this:

#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence:    Coil 1    Coil 2
;                            1     1
;                            0     1
;                            0     0
;                            1     0

b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main

avant:    for b1=1 to 3
                 high c.4         ; To coil 1
         pause b0
         high c.1         ; To coil 2
         pause b0
         low c.4
         pause b0
         low c.1
         pause b0
         next b1
         goto main
     
arriere:      for b1= 1 to 3
                 high c.4
                 pause b0
                 low c.1
                 pause b0
                 low c.4
                 pause b0
                 high c.1
                 pause b0
                 next b1
                 goto main[
GOT IT!
Thanks again, AllyCat. (y)
 
Last edited:

kfjl

Member
Still not right. Try with code=rich:

Rich (BB code):
let PinsB = %11000000 'B.4,B.5 Energised     B.7,B.6?
pause w2

let PinsB = %01000000 'B.5 Energised     B.6?
pause w2

let PinsB = %01100000 'B.5,B.6 Energised
pause w2

let PinsB = %00100000 'B.6 Energised     B.5?
pause w2

let PinsB = %00110000 'B.6,B.7 Energised     B.4, B.5?
pause w2

let PinsB = %00010000 'B.7 Energised     B.4?
pause w2

let PinsB = %10010000 'B.7,B.4 Energised
pause w2

You can get by without the "Pins" command with something like this:

#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
;             1      1
;             0      1
;             0      0
;             1      0

b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main

avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main

arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main
 

kfjl

Member
You don't need the forward slash on the first CODE word, but do need it on the final CODE word.

If you edit post 2 and remove the first forward slash, then hopefully things will look correct.
I did as you suggested (I hadn't noticed the forward slash). The 1's and 0's were under the words "Coil 1" and "Coil 2" before posting, then moved to the right once posted! Using Rich (BB code) as in post #3, they stay where I put them.
There seems to be a difference in the space-count for tabulations between this editor and the posted text editor. I'll avoid using tabulations in the futur.
Thanks for your reply.
 

Jack Burns

New Member
Check the Whitespace setting "Tab Key Inserts Spaces Instead of Tab" is selected, as that will allow you to continue using the TAB key with any new Tabs being replaced by spaces. So the code should copy to the Forum correctly.

Note:
Existing code which used TABS prior to this change will retain their TABS (rather than the TABS being converted to spaces), so you will probably need to edit the TABS before copying that code to the Forum, and that should hopefully make it display correctly.


26053
 

papaof2

Senior Member
8 spaces is the traditional tab size. Various word processor and IDE designers have used their choice of "tab" size over time until the original size has become muddled and the reasons behind it have become lost.

Think of the source of "tab" as in "tabulate" which generally meant having numbers or other data in columns. Until the 20th century, there were few numbers which needed a space greater than 8 digits so an 8 character "tab" was good for aligning columns of numbers. That bit of history seems to be getting lost when people want "just a little more" distance between words, numbers or other columns than a standard space. Remember that our hard copy standards mostly come from the printing industry which had names for everything including two sizes of spaces: the "en" space and the "em" space. If it's not obvious from their names, they are the width of the letter "n" and the letter "m" in the font type and size being used for the other text in the item to be printed.
 

kfjl

Member
Directly in the forum text editor with no cutting and pasting from elsewhere:

When I press the "TAB" button here, the cursor disappears. Is that "normal"?
The above line was written with eight spaces between each word, so I suppose the spaces are "en" ones. ("above" doesn't fit in eight spaces.

Looks like something Christopher Walken might have said. :)
 

kfjl

Member
Rich (BB code):
When        I        press        the        "TAB"        button        here,        the        cursor        disappears.        Is        that        "normal"?

The           above        line        was        written        with        eight        spaces        between        each        word,        so        I        suppose        the        spaces        are        "en"        ones.        ("above"        doesn't        fit        in        eight        spaces.
Cut and pasted from the previous post.🙃
 
Top