body_lturn: high 6 : low 5 : low 7 : high 4 ’ this should be your combination that turns the robot one way pause turn : gosub totalhalt return
body_rturn: high 5 : low 6 : low 4 : high 7 ’ this should be your combination that turns the robot the other way pause turn : gosub totalhalt return
Above is the code from the Start Here bot by fritsl that I believe you’re referring to. I don’t know much about Picaxe, but I know a little something about code.
Based on my knowledge, (and someone correct me if I’m wrong) you need pauses!
Without pauses, your code is telling the Picaxe to make pins 6, 5, and 7 high and low at the same exact time, which will inevitably make your code not work…
If it’s just the LEDs that aren’t working, check the polarity and make sure that the short lead, or the side of the LED that is flat, is connected to ground, and the longer LED, or the side that has a rounded edge, is connected (through a resistor as you may be burning them out) to your power source.
This walk-through by OddBot on LEDs will help you understand how to use them. https://www.robotshop.com/letsmakerobots/node/4948. A series resistor is required inline with the LED to limit the current. The walk through will explain how LEDs work and how to calculate the correct value for the series resistor.
For the LED troubleshooting board for my SHR, I think I used some unused outputs of the Picaxe to drive the LEDs, and inserted code to turn them on in different parts of the code. However, you could instead connect the LEDs in parallel to the motors, so they would light up when the motors are on.
When output A1 is high and A2 is low, the top motor should turn forward and the LED should light. When output B1 is high and B2 is low, the bottom motor should turn forward and the LED should light.
you are putting LED directly through a resistor with the motor … so you are not taking its own digital output.AM i right or not.
lets say this is the code:
body_lturn: high 6 : low 5 : low 7 : high 4 ’ this should be your combination that turns the robot one way pause turn : gosub totalhalt return body_rturn: high 5 : low 6 : low 4 : high 7 ’ this should be your combination that turns the robot the other way pause turn : gosub totalhalt return
After reading ODDBOT walkthrough of LED i think if i use T1-3/4 LEDs. there voltage drop is about 2 (according to the net) and i am going to supply 6v through PICAXE. So the resistor i will need will be: