Let's Make Robots!

Problem with digital input with axe 121 in 28 pin project board

I have connected an AXE121 to the 28 pin project boarrd. The light on the AXE 121 work according to the line but in the digital input there is no input shown.Also the program with inputs doesnt work on the bot.What may be the problem?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

But how about posting your code and a clear picture of the entire circuit or a schematic to assist in diagnosing. In the meantime there is a post here about using it.

I just read the datasheet and it calls for 3 inputs, not one. 

Other than that, what merser said --we can do nothing for you without seeing some code and/or wiring.

 

It is connected according to http://letsmakerobots.com/node/18876 to input points 1 2 and 3 respectively.

 

Code is

 

 

symbol varA = b0

symbol varB = b1

symbol varC = b2

symbol varD = b3

symbol varE = b4

symbol varF = b5

symbol varG = b6

symbol varH = b7

symbol varI = b14

symbol varJ = b15

symbol varK = b16

symbol varL = b17

symbol varM = b18

symbol varN = b19

symbol varO = b20

symbol varP = b21

symbol varQ = b22

symbol varR = b23

symbol varS = b24

symbol varT = b25

 

 

main:

label_2:

if pin1 = 1 and pin2 = 1 and pin3 = 1 then label_17 'Decision command

if pin1 = 1 and pin2 = 1 and pin3 = 0 then label_18 'Decision command

if pin1 = 1 and pin2 = 0 and pin3 = 0 then label_19 'Decision command

if pin1 = 0 and pin2 = 1 and pin3 = 1 then label_20 'Decision command

if pin1 = 0 and pin2 = 0 and pin3 = 1 then label_21 'Decision command

if pin1 = 0 and pin2 = 0 and pin3 = 0 then label_22 'Decision command

if pin7 = 0 then label_25 'Decision command

loop0:

goto loop0

 

label_25:

low 0

high 1

low 3

high 2

goto label_2

 

label_22: pause 10 'Wait command

low 1

high 0

goto label_2

 

label_21: pause 10 'Wait command

low 1

high 0

low 2

high 3

goto label_2

 

label_20: pause 10 'Wait command

low 3

high 2

goto label_2

 

label_19: pause 10 'Wait command

low 1

high 0

low 2

high 3

goto label_2

 

label_18: pause 10 'Wait command

low 1

high 0

goto label_2

 

label_17: pause 10 'Wait command

low 1

high 0

low 3

high 2

goto label_2

 

 

#no_table 'reduce download time

#no_data 'reduce download time

 

 

 

At the beginning of your code, you have labeled all your variables with names. This is fine, but really not needed. In your code here, you do not use any variables. There is no need to declare variables in picaxe BASIC, especially when you don't use them.

The next issue I see is all of your subroutines named label_number. While this is fine for the code itself, to the programmer (or anyone else trying to understand your code) it may work better to call them "Forward" or "Right_Spin" etc.

Now, your main issue:

Let's look at your main routine. You start with "main:" but in the very next line, you start a new routine called label_2. If your main loop is going to be called label_2, you can remove the "main:"

At the end of label_2, you have loop0: followed by goto loop0. Lets follow the program:

  1. main: (nothing happens)
  2. label_2 --if any of the if statements are true, we go down to a subroutine, do it and then start again at the top of label_2
  3. If none of the if statements are true, we continue on to the loop0 routine
  4. Once we are in loop0, we will get stuck there. We will never leave, your program is locked up in an endless loop

 

The main problem is in the digital input panel the inputs are not showing up.I removed the loop and tried to run it but it didnt run. The lights on AXE121 are working.

The above is translated into BASIC Code as:

'BASIC converted from Logicator for PICAXE flowsheet:

'C:\Users\Shwetanshu\Documents\Flowsheet1.plf

'Converted on 31/3/2012 at 6:28:34

 

symbol varA = b0

symbol varB = b1

symbol varC = b2

symbol varD = b3

symbol varE = b4

symbol varF = b5

symbol varG = b6

symbol varH = b7

symbol varI = b14

symbol varJ = b15

symbol varK = b16

symbol varL = b17

symbol varM = b18

symbol varN = b19

symbol varO = b20

symbol varP = b21

symbol varQ = b22

symbol varR = b23

symbol varS = b24

symbol varT = b25

 

 

main:

label_2:

if pin1 = 1 and pin2 = 1 and pin3 = 1 then label_17 'Decision command

if pin1 = 1 and pin2 = 1 and pin3 = 0 then label_18 'Decision command

if pin1 = 1 and pin2 = 0 and pin3 = 0 then label_19 'Decision command

if pin1 = 0 and pin2 = 1 and pin3 = 1 then label_20 'Decision command

if pin1 = 0 and pin2 = 0 and pin3 = 1 then label_21 'Decision command

if pin1 = 0 and pin2 = 0 and pin3 = 0 then label_22 'Decision command

loop0:

goto loop0

 

label_22: pause 10 'Wait command

low 1

high 0

goto label_2

 

label_21: pause 10 'Wait command

low 1

high 0

low 2

high 3

goto label_2

 

label_20: pause 10 'Wait command

low 3

high 2

goto label_2

 

label_19: pause 10 'Wait command

low 1

high 0

low 2

high 3

goto label_2

 

label_18: pause 10 'Wait command

low 1

high 0

goto label_2

 

label_17: pause 10 'Wait command

low 1

high 0

low 3

high 2

goto label_2

 

 

#no_table 'reduce download time

#no_data 'reduce download time

By the way thanks for helping.

It appears that you just posted the same code. If you removed the "loop0", the code you are showing now does not reflect that change.

Back to the flow of the code, if you were to simply remove "loop0:" and "goto loop0" you will still have a similar problem. The main loop (label_2) is not a loop. It does not end in "goto label-2" and thus, it will be executed once and then the code will go straight on to label_22 only to return to the start there after. 

On to your input issue. I believe there is some kinda input panel you have that allows you to see the state of your inputs. It also seems that when you trigger the line follow sensor, the state of the inputs is not changing in your window. If the indicator lights are coming on but inputs are not going low, you only have a few options:

  • You are not reading the inputs correctly
  • The line follow board is soldered incorrectly
  • You are not connected to the correct input pins

I wish I could give you a yes or no on your wiring but the picture you provided is not quite in focus enough or at the right angle to see what I need to see.

 

--one more thing to try is to simply check the outpu of the line board with a meter (or even just a LED) to be sure it is outputting the correct highs and lows.

i just made the flow chart on logicator and this was the code that it made.I have posted the image of the Flowchart.

I think you should recheck your soldering. Some of the soldering doesn’t look all that good.
It seems to me that the IR LED IR1 and transistor Q1 is not soldered to the pad at all.