Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Set Wx and Bx value

Status
Not open for further replies.

minhlam

Member level 2
Joined
Nov 15, 2004
Messages
48
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
321
Dear All
I use this code( count by Button) for control direction of motor (picaxe 08m)
Because I don't know much about programming and rarely use it, I don't know how to set the value for Wx.Bx, hope you guys can help me fix the code. I want from 1st pulse to 10th pulse pin 1 is high and from 11 to 20 pin2 is high. But my code value b is not set correctly so the part ( section REV)doesn't runing .I tried using symbol + < > written in many ways but it didn't workSo please guide me to rewrite the equation correctly:
What I must set value B0 for right: Thank you

Code:
 if b0= 1 to 10 then gosub label
if b0= 11 to 20 then gosub label
    and help me fix my code Thank you so much and HAPPY NEW YEAR
/////////////////////////////////////////////////////
    ;Please help me fix my code or give me  new code Thank you
           ;Picaxe 08m
      ; pin4 for off pin3 count b1= 1 to 10   pin 1 on off
   ;pin4 for off pin3 count b1 = 10 to  20   pin 2 on off
main:
       , ;COUNT BY BUTTON
      if pin3 = 1 and b1 <10 then goto mar   
      if pin3 = 1 and b1>10 and b1 = 20 then goto rev  ;  my bad code    
      if pin4=1 then low 1 low 2 endif
                   
                      goto main
 
mar:
       
      if pin3 = 1 and b1 <10 then goto mar
  inc b0 inc b1
          if b0= 2 then high 1 
          if pin4=1 then low 1 endif                                                      
                  b0=0
                  endif
                goto main
  rev: ; Goto rev not arrived here
       
      if pin3 = 1 and b1 >10 and b1=20 then goto rev
 if b0=1 then high 2
if pin4 =1 then low 2
        endif endif
 let b0=0   let b1 =0

goto main
 
Last edited by a moderator:

Hello!!

Some background info would be welcome.
I have no idea of what you are trying to do.

I use this code( count by Button)

What does it mean? Do you want to count the button presses?

I don't know how to set the value for Wx.Bx

Me neither. There is no Wx or Bx in your code. Assuming Bx would mean
B1, B2, etc... I would expect to find strings like that, but there are none.

Some schematic would be helpful. And also the environment you are using to
program, etc. And you don't say exactly what does not work...

But my code value b is not set correctly

Then describe it fully. Someting like this:
As this value is more than 10, I should expect bxxx to be low but it is high,

etc, etc...

Dora
 

Hello!!

Some background info would be welcome.
I have no idea of what you are trying to do.



What does it mean? Do you want to count the button presses?



Me neither. There is no Wx or Bx in your code. Assuming Bx would mean
B1, B2, etc... I would expect to find strings like that, but there are none.

Some schematic would be helpful. And also the environment you are using to
program, etc. And you don't say exactly what does not work...



Then describe it fully. Someting like this:
As this value is more than 10, I should expect bxxx to be low but it is high,

etc, etc...

Dora
Dear Dora
Thank you for your interest in my question, but I have a lot of trouble so I don't like use picaxe chip anymore, I hope you understand Thank you again for your time to watch my question and HAPPY NEW YEAR
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top