Foam Dart Sentry Turret Help

Hi,
This is my first time posting to the forum and I am also relatively new to coding and Arduino. I am trying to make a simple "sentry" that continually rotates. When a PIR sensor on the sentry is triggered, I want the sentry to flash an LED, sound a buzzer and activate a relay with some 12 volt dc motors connected to the output side of the relay. The motors will have some 3D printed wheels that will fling nerf darts. I want to have another servo that will push darts from a gravity fed magazine into the DC motor mechanism. So far I have everything working the way I would like in wokwi except I can't get the dart loading servo to work correctly. I am sure I am doing something silly and I would appreciate any help. Here is the wokwi link to the project. Nerf Sentry

Thank you for any and all guidance. Officially, I am making this for my kids be secretly I just want to learn new things

      if (loaderState = HIGH) {

A single "=" means "this is assigned that value"... You are doing this (in this example)
Two "==" means "this compared to that"

1 Like

Thank you so much. That was totally what I needed. I have probably looked over that function a dozen times and totally missed the missing ==.

1 Like

Turn on compile warnings in preferences and you will get a warning message when you do that.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.