Go Down

Topic: Arduino and HALL sensors problem (Read 933 times) previous topic - next topic

Grumpy_Mike

It would help if you post all the code that you are using. That code has undefined variables in it and will not compile. I would not expect it to work anyway because a loop executies quickly so I would expect it to zip up or down almost immediately to the limit.

jocoj100

I edited code, and it compiles now, edited code is in the first post.

Grumpy_Mike

So what have you done about the problem I told you about in reply #5? That will stop it from working.

But another thing:-
Looking at the code you seem to put the reset high on the counter, then you pulse it, which does nothing because the reset is high, then you leave it high. Unless you put the reset low it will not count. So:-
Reset high
Reset low
pulse the counter.

0AlphaOmega

on shift up It appears to give a alternating 1/0
and if you force an initial gear number, it does count down on shift down

You also need to de-bounce the gear lever (wait for it to drop back to central position)
For whom does the clock pulse? It pulses for you!

0AlphaOmega

Typical error ....  

Code: [Select]
if(GearDOWN=LOW)

You need another "="

Seems to work now

Why does 6 roll to 0? does your gearbox do that?
For whom does the clock pulse? It pulses for you!

Go Up