Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino MX220 : binking led problem what the ... ?
06-11-2014, 01:18 AM,
#1
Pinguino MX220 : binking led problem what the ... ?
Hi.
Weird problem : the code compiles and runs here it is

//start
int stepDelay = 400;

int serviceLed = 13;
int startDelay = 1500;

void setup()
{
//pinMode(serviceLed, OUTPUT);
//pinMode(D7, OUTPUT);
//pinMode(D6, OUTPUT);
pinMode(D5, OUTPUT);
pinMode(D4, OUTPUT);
delay(startDelay );
}

void loop()
{
//digitalWrite(serviceLed,HIGH);
oneStep();
//digitalWrite(serviceLed,LOW);
//oneStep();
}

void oneStep(){
digitalWrite(D4, HIGH);
digitalWrite(D5, HIGH);
//digitalWrite(D6, LOW);
//digitalWrite(D7, LOW);
delay(stepDelay);
digitalWrite(D4, LOW);
digitalWrite(D5, LOW);
//digitalWrite(D6, LOW);
//digitalWrite(D7, LOW);
delay (stepDelay);
/*
//digitalWrite(D4, LOW);
//digitalWrite(D5, LOW);
//digitalWrite(D6, HIGH);
//digitalWrite(D7, LOW);
//delay(stepDelay);
//digitalWrite(D4, LOW);
//digitalWrite(D5, LOW);
//digitalWrite(D6, LOW);
//digitalWrite(D7, HIGH);
//delay(stepDelay);
*/
}

according to me both D4 an and D5 should blink
D5 blinks, D4 does not.

When I remove D5 calls, then D4 blinks.
When I remove D4 calls ans let D5, D5 blinks.

When I let both : only one blinks, (D5), while D4 is perma ON.

What then hell is happening  ? 
Reply
06-11-2014, 02:22 AM, (This post was last modified: 06-11-2014, 02:45 AM by derf158.)
#2
RE: Pinguino MX220 : binking led problem what the ... ?
you have to remove the D, i just tried this with my 8 bit 4550 and it works

pinMode(7, OUTPUT);



pinMode(6, OUTPUT);

pinMode(5, OUTPUT);

pinMode(4, OUTPUT);


digitalWrite(4, HIGH);

digitalWrite(5, HIGH);
Reply
06-11-2014, 10:30 AM, (This post was last modified: 06-11-2014, 10:31 AM by pingotg.)
#3
RE: Pinguino MX220 : binking led problem what the ... ?
I was thinking the LEDs would be D9 and D13

Either way, I don't understand why the code would behave as described!

John
Reply
06-11-2014, 12:20 PM, (This post was last modified: 06-11-2014, 10:02 PM by KrissNC.)
#4
RE: Pinguino MX220 : binking led problem what the ... ?
Yup I forgot to mention : I connected 2 external Leds on D4 and D5... using 330ohms resistor ... (as shown in a turorial)

(the whole point is to drive a stepper motor, 4 wires : D4 D5 D6 D7)  but since it didnt work I went to 1 wire, then the 2nd, and bam... bug

I'll try without the Ds


Edit :

Tried : same thing happens

If Try with each pin 1 by 1, D0 to D13  the led blinks
But When I try some pairs : One blinks and the other is perma  enlighted

Fianlly managed to have 4 independant pins on my mx220 : 13 11 9  and 4
for some reason (and this is the totally absurd thing) some other digital pins dont work when some already are in use.

even more weird :
digitalWrite(13, LOW);

digitalWrite(9, HIGH);
digitalWrite(11, HIGH);
digitalWrite(4, HIGH);

works, while 
digitalWrite(13, LOW);

digitalWrite(11, HIGH);
digitalWrite(9, HIGH);
digitalWrite(4, HIGH);
doesnt (invert line 2 and 3...) JUST ABSURD (this is probably a compilation problem , or a mistach with card model)

Please name me one version of a RELIABLE pinguino board, before I switch to Arduino

I can't afford sily things like that to waste my time 

When I finally had 4 independant en affectable pins, I managed to drive my stepper motor... Jut not being able to use D 4 D5 D6 D7 juste drive me mad. Lost 12 hours trying to find pins, and there is no way I can Drive more motors, even thow I should have 14 pines (3 * 4 wires motors)
Reply
07-11-2014, 12:45 AM, (This post was last modified: 07-11-2014, 12:58 AM by derf158.)
#5
RE: Pinguino MX220 : binking led problem what the ... ?
KrissNC,
i have my stepper wired on pind 4,5,6,7 on my 4550 8 bit and the PDE you wrote works.Maybe you have a bad board?
which stepper driver are you using? i am using the ULN2003A.
fred
Reply
07-11-2014, 11:31 AM,
#6
RE: Pinguino MX220 : binking led problem what the ... ?
KrissNC,

I see that you are compiling the code for Olimex MX220 board and you didn't mention what board you are using, but it could be 32MX220 board. You may want to check the post http://forum.pinguino.cc/showthread.php?tid=4313 though it doesn't explain the behavior of your LEDs.

DJ
Reply
07-11-2014, 03:55 PM, (This post was last modified: 07-11-2014, 03:56 PM by pingotg.)
#7
RE: Pinguino MX220 : binking led problem what the ... ?
Oh well, when I posted about things working for me I did first select the right board Smile

The only problem I really have with the Olimex 220 board is that it hasn't enough flash available (which is why I posted about how to use more).

John
Reply
08-11-2014, 07:48 PM, (This post was last modified: 08-11-2014, 07:53 PM by KrissNC.)
#8
RE: Pinguino MX220 : binking led problem what the ... ?
Hi there, the board is a Pic32 pinguino MX220 from Olimex. the stepper driver is a ULN2003 but that's not the problem since the problem is having non independant Outputs to simply lighten leds. I found 4 outputs and could driver my stepper no problem, the problem is I could not use D4 D5 D6 D7 , ou D0 D1 D2 D3... (or event those 2 series for 2 motors) anyone with a pic32 pinguino mx220 could try to have 4 leds on subsequents outputs , blinking in turn ? / What Pinguino board would you advise me ? it seems this 220 Mix is a crap Thanks all for your help till then
Reply
09-11-2014, 07:24 PM, (This post was last modified: 10-11-2014, 10:42 AM by pingotg.)
#9
RE: Pinguino MX220 : binking led problem what the ... ?
I have no idea what you're doing wrong but such LEDs work fine for me on D4,D5,D6,D7.

It's hard to think of much simpler LEDs or code. What circuit are you using attached to the board?

John
Reply
10-11-2014, 03:25 PM, (This post was last modified: 10-11-2014, 03:28 PM by KrissNC.)
#10
RE: Pinguino MX220 : binking led problem what the ... ?
Hi pingotg 

Could you Send me your code and the wiring you use to have D4567 with leds ?

I had leds through 330 ohms res,  first

New way
Now I have pin trought 1k Resistance to the base of a 2N2222 transistor,  emitter to ground
Collector = 5v, 4k7 rez and led then the collector of the 2222...

It works with 13 11 9 4 so I guess it should work with 4 5 6 7



is your card a pic32 pinguino 220mx ? (thats the key imo)

Isn't it very strange it work from D0 to D12 led by led, but not 4 consecutive ? (not even 2)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)