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?

I’m sure somebody here will be able to help

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.

3 inputs

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.

**I have connected it to 3 inputs **

 

It is connected according to https://www.robotshop.com/letsmakerobots/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

 

 

 

Got some weird stuff here.

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

 

Removed the 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.

Using LOGICATOR

Untitled.jpg

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.

The loop is still there

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.

Here are some pics

WP_000048.jpg

WP_000049.jpg

WP_000051.jpg

Logicator did it

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

So far so good

Everything appears pretty good actually. The connections look right and the soldering isn’t too bad. To double check and thus eliminate hardware as the issue, could you test the output(s) of the board with a meter or a LED? If you are getting proper highs and lows from there, you know it is probably an issue with the code. 

Out of curiosity, did this work when you ran it directly from logicator? Why did you decide to convert to code? Do you have to do this to sync with the chip? --Also, tell me more about this “input panel” and how it works.

logicator

With logicator you can just design the flowchart and it directly converts it into code.For the purpose of posting the code on forum I used convert flowsheet to basic.It is not necessary to syn with the chip.Either you can write the code or make a flowchart.Both are good.

 

As the programme runs the digital panel shows the changing state of ouputs, motors and inputs as they are.

I think you should recheck

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.

checked

I know that the soldering is pretty bad thats why I have checked the soldering many time including IR1 and QR2.The light on the board is correctly blinking with black and white line.Now just the checking of high and lows in output is with a meter is remaining.

You might also check if the

You might also check if the LED’s are working by using your mobile camera as the IR light is visible to the camera.

As you can see all 3 are

As you can see all 3 are working

Just noticed something

I was taking a second look at your photos and I noticed something I had not seen before.

 

On your line follow board:

Is there something funny at pin 7?
Why is there a stray bit of wire (a 2-hole breadboard jumper, actually) stuck in the IC socket between pins 13 and 14? 

Its Nothing

Its just that both pins are broken so just attached a wire. The 13 amd 14 are not connected.It looks like that from above.Sorry forgot to mention that but its working fine I have checked it many times.

Well, it goes back to step by step

At this point, we have no idea what it is or could be. We simply need to check each thing, down the chain.

First, with a multimeter (or even just a LED) check each output from the line follow board. Confirm that it is indeed outputting highs and lows when it sees white and black. Now repeat this test at the end of the jumper wires -right where you would plug it into the 28x board. Confirm these high/low outputs are getting through the jumpers. This seems silly, I know but I have had jumpers get stretched out and actually not make a connection. Double check your signal is getting through the wires.

Now, move on to the 28x board. Unplug your line follow board entirely. Run your terminal or debug window or input panel or whatever tells you the state of your inputs. Test each of your inputs with a jumper wire. Connect the input to ground and confirm it is showing 0 or low. Repeat this to 5v and confirm the input is a 1 (high). Make note of what pins you are playing with and what pin numbers they correspond to in your debug window. Be sure you are connecting to the same pins you are using in your code.

Now, if your line follow board is outputting correctly and you inputs are reading things correctly and you are using the right pins, then the problem must lie in your code. 

–I still think that jumper wire hap-hazardly stuck in between 2 legs of a chip is not good though… (I’m not sayin’, I’m just sayin’)