Smart Trashbin metal detector with coin reward... need help

If an AI shall "write" code that is really functional your description has to be much more specific than with asking a human.

As long as you can't describe the pure functional level of your device:
how should anybody know how to write code for it?

person A: "can you build me a vehicle"

person B: if you can specify

  • on land?

    • plain street?
    • off road?
  • on water

    • over water or under water
  • in the air

    • fixed wing / rotating wings

what kind of engine?
electric or combustion?

  • roughly estimated size

etc. etc.

right now you are asking
"can you build me a vehice?"

OK you give a little bit more information
4 wheel vehicle with electric drive and a distance sensor

still way too less description to write a specific code fo it

So what is the function of servo 1?
So what is the function of servo 2?
So what is the function of servo 3?
So what is the function of servo 4?

the start is learning fundamentals about programming
As a easy to understand picture
it is very likely that you know this tool


it is for cutting gras
very easy to understand how to use it.
needs 30 seconds to understand it and 2 minutes of practising to master it

If your job is to cut this area of gras

well this tool is not very good suited
It would take you weeks to cut this big area

Same with programming.

Sure you can jump onto this mowing machine fiddling around for days and weeks until you know:

  • this lever does this,
  • this lever does this, etc. etc.

Another person that takes the 5 hours teaching lessons walks out after 5 hours
climbs on the mower, puts all levers to the right position, plugs in key, turns key
and
.......starts mowing

while the "fiddler" is still fiddling around with the levers

So my recommendation is
Take a look into this tutorial:

Arduino Programming Course

It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.

After that google for a democode that does nothing more than sweeping a single servo
to understand how controlling a servo is done

It is your choice to feel "very active with fiddling around moving in circles but not coming closer to finishing your project

or

learning the basics
which might need patience until the AHA!-moment kicks in

best regards Stefan

1 Like