Hi there,
I am a Dutch engineering student, and i need some help with Arduino. We need to build a hovercraft that can detect objects, and react differently every time. To achieve that in need to program my arduino, but there's a catch. Although i know what i need in the code, i do not know how to write it in c++.
what’s supposed to happen is this: I fly the hovercraft remotely controlled towards a buoy/sea mark. I will gently nudge the buoy, and that will activate a button/pressure sensor. This is the beginning! The push of button will go to the arduino. The signal used to be LOW on the sensor port, but during the contact it is HIGH. That should trigger the arduino to send a current to transistor 1. This transistor should than be triggered for 3 seconds. An external circuit will take care of the special effect.
When I hit the next buoy, the code should repeat it self. Except for the fact that now transistor two should be activated for 3 seconds.
I thought that i should do that by using a mathematical row. Activate N+1. N is the previous active transistor. so when i hit the first buoy, it is 0+1=1. This should be capable to activate 10 different effects. But i can't find a proper way to write these code descriptions in C++.
Would you please help me? A basic set up in code should be enough i guess.
Alex