Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
Little-C , no caps on pin 10. Nice tip though.Ok guys , tks for the tips so far. I'll try to test it with buttons as soon as i get home and let you know what happened. If it works, i'll try on the pic. cheers.
[...] when i approach my finger to the circuit all the leds start to blink erratically,and if i touch the wire they stop.
I'm using a breadboard but it's brand new, and i've played with the wires already to see if it changes but it doesn't .
Also, don't you think there's something wrong with my code? I've played with commenting, changing the order, changing values of the 3 main lines ( DS , SH , ST ) and it seems that i can get action on the outputs with only the SH line active on the code. Of course they light up in a little crazy fashion ,but they do. I'm trying to identify each line's behavior in practice, and find out how i would procede if i wanted to..say, light just LED "Q3" . Or even better, blink it.
void main(){loop:delay_ms(200);output_bit(DS,1);/*You never change this bit. If you don't intend to, just set it outside the loop.While this is not causing the particular issue, it's sloppy programming ;)*/output_bit(SH,1);delay_ms(1); // try a short delay here, just for testing.output_bit(SH,0);delay_ms(1);output_bit(ST,1);delay_ms(1);output_bit(ST,0);delay_ms(200); //-No reason for this, just increase the line on top of the loop if neededgoto loop;}
void main(){n=1 // remember to initialize n as a booleanloop:delay_ms(400);output_bit(DS,n);output_bit(SH,1);delay_ms(1); // try a short delay here, just for testing.output_bit(SH,0);delay_ms(1);output_bit(ST,1);delay_ms(1);output_bit(ST,0); if (n==1) {n=0} else {n=1}goto loop;}
By the way, i'm not using a voltage regulator, but i'm feeding the circuit with a nice brand new digital regulated power source ( 0-30V , 0-3A) . I'll try to add the caps anyway.
PS: Strange things happen with me and the circuits since i've left chernobyl... (just kidding)