Announcement

Collapse
No announcement yet.

Turning stepper motors with button on 4Duino

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Turning stepper motors with button on 4Duino

    Hello all,

    I am trying to turn stepper motors using buttons on the 4Duino. When the button is pressed the motors will spin and when the button is pressed again the motors should stop. I have this working except the monitoring for touch is preventing the motors from spinning at the correct speed. The command state = Display.touch_Get(TOUCH_STATUS); causes the delay. Any ideas on how to work around this so the button still turns the motors on/off but I can get the stepper turning faster?

    Thanks,

    Rob

  • #2
    Hi Rob,

    This delay might be fixed by instead using the .touch_GetPen() function which returns the touch state of the display, like touch_Get(TOUCH_STATUS).

    I recommend you have a look at this TouchTest example for 4Duino to see how it the function is used.

    Let me know if this helps,
    Adem

    Comment


    • #3
      I appreciate the response ademdeojee. Unfortunately I do not understand. I tried copying the code and it won't compile.

      I don't have "ESP8266WiFi.h" or "GFX4d.h". Where can I get those?

      Comment


      • #4
        So I was able to get the libraries off github. But I'm still not able to compile.

        Comment


        • #5
          Hi Rob,

          What error are you getting when you try to compile the code? You can send a screenshot if you like.

          Comment


          • #6
            During the compile this is what I get:

            Verifying...
            In file included from C:\Users\robert_jenkins\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28:0,

            from C:\Users\robert_jenkins\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,

            from C:\Users\robert_jenkins\Documents\Keracell\touchtest\touchtest.ino:6:

            C:\Users\robert_jenkins\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:10: fatal error: functional: No such file or directory

            #include <functional>

            Comment


            • #7
              Hi Rob,

              I am not exactly sure what leads to this error, however since there are errors finding library files I must ask you to ensure you have all relevant libraries installed and locatable. Are you using the Arduino IDE or Workshop4? Either way I would recommend looking on page 15 of the datasheet and following the steps to make sure that everything is setup correctly.

              If you are still having problems after this, you can send your Workshop4 project (File -> Zip Project) or Arduino code and I'll see if I get the same errors.

              Regards,
              Adem

              Comment


              • #8
                That is my problem. I don't really understand how to ensure I have all the library files. I will keep reading to figure that out. I'm just really new at this.

                Comment


                • #9
                  Hi again Rob,

                  Like I said, if you want you can send me your Project in your reply and I'll see if I get the same issue, and if I do not, I'll try and figure out what I have that you don't. Also, I completely understand if you are new, no need to worry about that, I am relatively new as well 😊.

                  Regards,
                  Adem

                  Comment

                  Working...
                  X