i suck so much

Code: [Select] Floor++; Floor=Floor+2; Floor=Floor+3;

Floor++; Floor=Floor+2; Floor=Floor+3;

Quote from: copachino on Nov 19, 2012, 02:59 amCode: [Select] Floor++; Floor=Floor+2; Floor=Floor+3; I doubt this will end up with the correct value in Floor. I haven't reviewed the whole sketch, but I'd expect to see Floor assigned to the value corresponding to the floor it has just reached (Floor = 3; etc) or incremented / decremented by one each time is passes a floor ( Floor++; Floor--; ).

for(hallcount=0,hallcount<=3,hallcaount++)stepper(CW) or (CCW)

because i dont need to know the distance i need to know how many pulse the sensor gives, because in each floor there is a magnet, that magnet "sense" the elevator, so if i want to go from the first floor to the 4th i just need to start the stepper and stop it untill the the the hallcounter its 3, i dont need to measure distance or count steps, i just need to know in which direction i want the stepper to run