Hi i am thinking of very ambitious project ( ambitious as new learner in coding )
i will have a linear guide that will move on it a car
( camera attached to a base with bearings with attached belt and a dc motor in the end of linear guide)
i want to have 6 prefix positions that the car can stop depending what button i will press .
i dont want to use standalone switches as position , my goal is to use 2 ''magnetic sensors'' that one will count through magnets the position and the other one will be responsible for the stop
The magnet switch of counting position will triggered only with South polarity magnets and the ''stop Magnet switch'' will be triggered with North polarity magnets
between each stop magnets will be 2 ''count magnets'' so the code will count 2 pushes (if we imagine that are like push buttons) to understand that is in the right position and then the ''stop sensor switch'' will know that when triggered will stop the car
the arduino has to store the position that stopped so to know each time it has a call , to go to an other position .... travel the right way (left or right)
i want to use 2 magnets for count position as later i want to make the motor slow down when reach the right position magnet
the positions will not be the same distance so with the 2 magnets will be always easy to slow down motor the same distance before stop magnet either going left or right
i have attached and a picture with how will be , maybe you understand better what i want to do
as i told in the begging .. this is a very ambitious project for someone new to all this.. but hope with the right guidance of yours.. step by step learn..make mistakes(lot of them sure) learn again and build it the same time
for sure i know that have to begin with the ''compound operators'', ''comparison operators''