{"id":1856,"date":"2025-06-24T09:39:49","date_gmt":"2025-06-24T09:39:49","guid":{"rendered":"https:\/\/learnbydoing.dev\/?p=1856"},"modified":"2026-01-10T22:43:34","modified_gmt":"2026-01-10T22:43:34","slug":"how-to-use-a-potentiometer-with-arduino-2","status":"publish","type":"post","link":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/","title":{"rendered":"How to use a NEMA 17 with Arduino"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1856\" class=\"elementor elementor-1856\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e28ab35 e-flex e-con-boxed e-con e-parent\" data-id=\"e28ab35\" data-element_type=\"container\" data-e-type=\"container\" id=\"content\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-62ab6e3 e-con-full e-flex e-con e-child\" data-id=\"62ab6e3\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-62ab203 elementor-align-center elementor-widget elementor-widget-post-info\" data-id=\"62ab203\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-2c98363 elementor-inline-item\" itemprop=\"about\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-terms\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-post-info__terms-list\">\n\t\t\t\t<span class=\"elementor-post-info__terms-list-item\">Arduino<\/span>, <span class=\"elementor-post-info__terms-list-item\">Electronics<\/span>, <span class=\"elementor-post-info__terms-list-item\">Tutorials<\/span>\t\t\t\t<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0650e10 e-con-full e-flex e-con e-child\" data-id=\"0650e10\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ac19582 elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"ac19582\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"75\" height=\"75\" viewBox=\"0 0 75 75\" fill=\"none\"><path d=\"M74.9999 75H13.1889V73.0002H71.5859L0.460938 1.87521L1.87515 0.460999L73.0001 71.586V13.1889H74.9999V75Z\" fill=\"white\"><\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-47aa245d e-flex e-con-boxed e-con e-parent\" data-id=\"47aa245d\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-45647d2 elementor-widget elementor-widget-image\" data-id=\"45647d2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-1024x576.webp\" class=\"attachment-large size-large wp-image-2058\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-1024x576.webp 1024w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-300x169.webp 300w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-768x432.webp 768w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-1536x864.webp 1536w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2-18x10.webp 18w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-261c3d8 elementor-widget elementor-widget-text-editor\" data-id=\"261c3d8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span class=\"TextRun SCXW26943125 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW26943125 BCX0\">In this tutorial, we will walk through the essential steps <\/span><span class=\"NormalTextRun SCXW26943125 BCX0\">required<\/span><span class=\"NormalTextRun SCXW26943125 BCX0\"> to program an Arduino Uno to control a NEMA 17 stepper motor. We will also cover in detail how to correctly wire all the components involved, ensuring a reliable and safe operation of the entire system.<\/span><\/span><span class=\"EOP SCXW26943125 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-12a4ca0 elementor-widget elementor-widget-text-editor\" data-id=\"12a4ca0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\ud83d\udd0d <strong>What is a NEMA 17?<\/strong><\/span><\/span><\/span><\/span><\/span><\/span><\/h3><p data-start=\"67\" data-end=\"308\">The <strong data-start=\"71\" data-end=\"82\">NEMA 17<\/strong> is a type of <strong data-start=\"96\" data-end=\"113\">stepper motor<\/strong> widely used in electronics, robotics, and 3D printing projects. The term <em data-start=\"187\" data-end=\"196\">NEMA 17<\/em> refers to the standard size of the <strong data-start=\"232\" data-end=\"253\">motor\u2019s faceplate<\/strong>, which measures <strong data-start=\"270\" data-end=\"294\">1.7 inches (43.2 mm)<\/strong> on each side.<\/p><p data-start=\"310\" data-end=\"482\">This motor rotates in <strong data-start=\"332\" data-end=\"349\">precise steps<\/strong>, typically 200 steps per revolution (1.8\u00b0 per step), making it ideal for applications where <strong data-start=\"442\" data-end=\"469\">accurate motion control<\/strong> is required.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c983314 elementor-widget elementor-widget-text-editor\" data-id=\"c983314\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\ud83d\udcd1 <strong>How does it work?<\/strong><\/span><\/span><\/h3><p data-start=\"64\" data-end=\"302\">Inside a NEMA 17 stepper motor are multiple electromagnetic windings arranged to produce discrete angular steps. By applying voltage to these coils in a specific sequence, the motor rotates by a fixed angle for each signal pulse received.<\/p><p data-start=\"304\" data-end=\"561\">This controlled movement is managed by a driver (such as the A4988), which receives digital signals from the Arduino and converts them into the correct electrical sequence for the motor\u2019s coils. This allows for precise and repeatable rotation, step by step.<\/p><p data-start=\"563\" data-end=\"635\">The control is handled through two main pins connected to the Arduino:<\/p><ul data-start=\"636\" data-end=\"783\"><li data-start=\"636\" data-end=\"702\"><p data-start=\"638\" data-end=\"702\"><strong data-start=\"638\" data-end=\"657\">DIR (direction)<\/strong>: sets the rotation direction of the motor.<\/p><\/li><li data-start=\"703\" data-end=\"783\"><p data-start=\"705\" data-end=\"783\"><strong data-start=\"705\" data-end=\"720\">STEP (step)<\/strong>: receives a pulse each time the motor should advance one step.<\/p><\/li><\/ul><p data-start=\"785\" data-end=\"974\">By adjusting the frequency of the signals sent to the STEP pin, you can control the rotation speed of the motor. Changing the logic level of the DIR pin will reverse the rotation direction.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-72ea8bb elementor-widget elementor-widget-image\" data-id=\"72ea8bb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-1024x576.webp\" class=\"attachment-large size-large wp-image-1859\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-1024x576.webp 1024w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-300x169.webp 300w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-768x432.webp 768w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-1536x864.webp 1536w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_-18x10.webp 18w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Testo-del-paragrafo-_1_.webp 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-324d52d elementor-widget elementor-widget-text-editor\" data-id=\"324d52d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0\ud83d\udcdd Required components<\/span><\/span><\/h3><ul><li data-start=\"1737\" data-end=\"1780\"><p data-start=\"1739\" data-end=\"1780\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1 x <\/span><\/span><strong data-start=\"1743\" data-end=\"1758\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Arduino Uno<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> (or compatible board)<\/span><\/span><\/p><\/li><li data-start=\"1781\" data-end=\"1823\"><p data-start=\"1783\" data-end=\"1823\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1 x <span class=\"TextRun SCXW47845289 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW47845289 BCX0\"><strong>Stepper Motor<\/strong> Driver (e.g., A4988 or DRV8825)<\/span><\/span><\/span><\/span><\/p><\/li><li data-start=\"1824\" data-end=\"1838\"><p data-start=\"1826\" data-end=\"1838\"><span class=\"TextRun SCXW229325735 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW229325735 BCX0\"><strong>Suitable power supply<\/strong> for the motor<\/span><\/span><\/p><\/li><li data-start=\"1839\" data-end=\"1855\"><p data-start=\"1841\" data-end=\"1855\"><strong>Jumper wires<\/strong><\/p><\/li><li data-start=\"1839\" data-end=\"1855\"><strong><span class=\"TextRun SCXW86195701 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW86195701 BCX0\">Breadboard<\/span><\/span><span class=\"EOP SCXW86195701 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/strong><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a236fe0 elementor-widget elementor-widget-text-editor\" data-id=\"a236fe0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 aria-level=\"2\"><b><span data-contrast=\"none\">Step 1: Wiring the Electronics<\/span><\/b><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3><h6><span data-contrast=\"auto\">The first step is to properly connect the electronic components. Specifically, the NEMA 17 stepper motor must be connected to the driver (A4988), which in turn is connected to the Arduino Uno. Correct cable arrangement is essential to ensure proper operation and avoid accidental damage.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/h6><h6><span data-contrast=\"auto\">Below is an example wiring diagram showing the connections between power supply, Arduino, driver, and motor.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ee10903 elementor-widget elementor-widget-image\" data-id=\"ee10903\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"605\" height=\"817\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/image.webp\" class=\"attachment-large size-large wp-image-1860\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/image.webp 605w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/image-222x300.webp 222w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/image-9x12.webp 9w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e04c0ca elementor-widget elementor-widget-text-editor\" data-id=\"e04c0ca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2 aria-level=\"2\">\ud83d\udda5\ufe0f\u200b<b><span data-contrast=\"none\">Step 2: Writing the Code<\/span><\/b><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h2><p><span data-contrast=\"auto\">Once the wiring is complete, we move on to programming. We\u2019ll use the Arduino Uno to send control signals to the A4988 driver, which in turn drives the NEMA 17 stepper motor. To simplify the handling of step (STEP) and direction (DIR) signals, we&#8217;ll use the AccelStepper library, which is far more flexible than the standard Stepper library.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p><p><span data-contrast=\"auto\">Before uploading the code, make sure to install the AccelStepper library:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p><ol><li><span data-contrast=\"auto\"> Open the Arduino IDE<\/span><\/li><li><span data-contrast=\"auto\"> Go to Sketch &gt; Include Library &gt; Manage Libraries<\/span><\/li><li><span data-contrast=\"auto\"> Search for AccelStepper and install it<\/span><\/li><\/ol>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e1ef5c9 elementor-widget elementor-widget-text-editor\" data-id=\"e1ef5c9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Codice Arduino completo<\/span><\/span><\/span><\/span><\/h3><p data-start=\"1922\" data-end=\"2017\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Ecco il codice Arduino completo per controllare il NEMA 17:<\/span><\/span><\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1ba2cef elementor-widget elementor-widget-code-highlight\" data-id=\"1ba2cef\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>#include <AccelStepper.h>\r\n\r\n#define STEP_PIN 3\r\n#define DIR_PIN 2\r\n\r\n\/\/ Driver type compatible with A4988\r\nAccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);\r\n\r\nvoid setup() {\r\n  stepper.setMaxSpeed(1000);      \/\/ Sets the maximum speed (steps\/sec)\r\n  stepper.setAcceleration(500);    \/\/ Sets the acceleration (steps\/sec\u00b2)\r\n  stepper.moveTo(200);             \/\/ Number of steps to perform\r\n}\r\n\r\nvoid loop() {\r\n  if (stepper.distanceToGo() == 0) {\r\n    delay(500);                                  \/\/ Optional pause between reversals\r\n    stepper.moveTo(-stepper.currentPosition());  \/\/ Change direction\r\n  }\r\n  stepper.run();  \/\/ Execute the movement\r\n}\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7a888ec elementor-widget elementor-widget-text-editor\" data-id=\"7a888ec\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3><b>\ud83d\udd0e\u00a0<\/b><b>Breaking down the Code<\/b><\/h3><p>Let\u2019s review the code section by section:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-01f8801 elementor-widget elementor-widget-code-highlight\" data-id=\"01f8801\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>#include <AccelStepper.h><\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-455a2f8 elementor-widget elementor-widget-text-editor\" data-id=\"455a2f8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5 data-start=\"1857\" data-end=\"1885\"><strong data-start=\"3\" data-end=\"117\" data-is-last-node=\"\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Include la libreria AccelStepper,<\/span><\/span><\/strong><\/h5><h6 data-start=\"1857\" data-end=\"1885\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">che semplifica il controllo dei motori passo-passo utilizzando driver come l&#8217;A4988.<\/span><\/span><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6503883 elementor-widget elementor-widget-code-highlight\" data-id=\"6503883\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>#define STEP_PIN 3\r\n#define DIR_PIN 2\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2547d99 elementor-widget elementor-widget-text-editor\" data-id=\"2547d99\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"0\" data-end=\"69\"><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Definisce i pin digitali Arduino utilizzati per controllare il driver A4988:<\/span><\/span><\/strong><\/p><p data-start=\"71\" data-end=\"178\" data-is-last-node=\"\" data-is-only-node=\"\"><strong data-start=\"71\" data-end=\"87\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP_PIN (3)<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> invia gli impulsi per muovere il motore in avanti. <\/span><\/span><br data-start=\"131\" data-end=\"134\" data-is-only-node=\"\" \/><strong data-start=\"134\" data-end=\"149\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">DIR_PIN (2)<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> imposta la direzione di rotazione.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d361b1c elementor-widget elementor-widget-code-highlight\" data-id=\"d361b1c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b51cf90 elementor-widget elementor-widget-text-editor\" data-id=\"b51cf90\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3514\" data-end=\"3644\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0<\/span><\/span><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Crea un <\/span><\/span><code data-start=\"13\" data-end=\"22\">stepper<\/code><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">oggetto<\/span><\/span><\/strong><\/p><p data-start=\"3514\" data-end=\"3644\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Utilizzando il <\/span><\/span><code data-start=\"40\" data-end=\"48\">DRIVER<\/code><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">tipo compatibile con driver come A4988 e DRV8825, <\/span><\/span><br data-start=\"115\" data-end=\"118\" \/><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">specifica i pin STEP e DIR da utilizzare.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-85beade elementor-widget elementor-widget-code-highlight\" data-id=\"85beade\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>void setup() {\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8c151f2 elementor-widget elementor-widget-text-editor\" data-id=\"8c151f2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Avvia la funzione <\/span><\/span><strong data-start=\"40\" data-end=\"50\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">loop()<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> , che viene eseguita continuamente.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b11d22b elementor-widget elementor-widget-code-highlight\" data-id=\"b11d22b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp> stepper.setMaxSpeed(1000);<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d4803c2 elementor-widget elementor-widget-text-editor\" data-id=\"d4803c2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Imposta la velocit\u00e0 massima del motore a 1000 passi al secondo.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4e35756 elementor-widget elementor-widget-code-highlight\" data-id=\"4e35756\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>stepper.setAcceleration(500);<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2e23ce5 elementor-widget elementor-widget-text-editor\" data-id=\"2e23ce5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Imposta l&#8217;accelerazione a 500 passi al secondo quadrato per partenze e arresti pi\u00f9 fluidi.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bd08061 elementor-widget elementor-widget-code-highlight\" data-id=\"bd08061\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>  stepper.moveTo(200);\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d506b01 elementor-widget elementor-widget-text-editor\" data-id=\"d506b01\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Comanda al motore di muoversi di 200 passi dalla posizione attuale.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2697e24 elementor-widget elementor-widget-code-highlight\" data-id=\"2697e24\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>void loop() {<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b3f863 elementor-widget elementor-widget-text-editor\" data-id=\"0b3f863\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<article class=\"text-token-text-primary w-full\" dir=\"auto\" data-testid=\"conversation-turn-12\" data-scroll-anchor=\"true\"><div class=\"text-base my-auto mx-auto py-5 [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\"><div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto flex max-w-(--thread-content-max-width) flex-1 text-base gap-4 md:gap-5 lg:gap-6 group\/turn-messages focus-visible:outline-hidden\" tabindex=\"-1\"><div class=\"group\/conversation-turn relative flex w-full min-w-0 flex-col agent-turn\"><div class=\"relative flex-col gap-1 md:gap-3\"><div class=\"flex max-w-full flex-col grow\"><div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"4b00c693-ff39-494a-bddd-180655e61804\" data-message-model-slug=\"gpt-4-1-mini\"><div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\"><div class=\"markdown prose dark:prose-invert w-full break-words dark\"><p data-start=\"0\" data-end=\"54\" data-is-last-node=\"\" data-is-only-node=\"\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Avvia la funzione loop(), che viene eseguita continuamente.<\/span><\/span><\/p><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/article>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4d1621c elementor-widget elementor-widget-code-highlight\" data-id=\"4d1621c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>if (stepper.distanceToGo() == 0) {<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-18ed5d7 elementor-widget elementor-widget-text-editor\" data-id=\"18ed5d7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Controlla se il motore ha raggiunto la destinazione (ovvero ha completato tutti i passaggi richiesti).<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6e309ad elementor-widget elementor-widget-code-highlight\" data-id=\"6e309ad\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp> delay(500);<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-36be69f elementor-widget elementor-widget-text-editor\" data-id=\"36be69f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Fai una pausa di mezzo secondo prima di invertire la direzione. Questo aiuta a rendere il movimento pi\u00f9 visibile e fluido.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ca49810 elementor-widget elementor-widget-code-highlight\" data-id=\"ca49810\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>    stepper.moveTo(-stepper.currentPosition());\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3dd8321 elementor-widget elementor-widget-text-editor\" data-id=\"3dd8321\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0Inverti la direzione: se il motore era a +200, torna a -200 e cos\u00ec via.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d3a40b4 elementor-widget elementor-widget-code-highlight\" data-id=\"d3a40b4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp> }\r\n  stepper.run();<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e7a0dfa elementor-widget elementor-widget-text-editor\" data-id=\"e7a0dfa\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">\u00a0stepper.run() \u00e8 necessario per far avanzare il motore di un passo alla volta in base alla velocit\u00e0 e all&#8217;accelerazione impostate.<\/span><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c92ae44 elementor-widget elementor-widget-text-editor\" data-id=\"c92ae44\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3><b style=\"color: inherit; font-family: inherit; font-size: 2rem; text-wrap-mode: initial;\"><span data-contrast=\"none\">\ud83d\udee0\ufe0fStep 3: Troubleshooting<\/span><\/b><span style=\"color: inherit; font-family: inherit; font-size: 2rem; text-wrap-mode: initial;\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3><p><strong>\u00a0<\/strong><\/p><p><strong>Motor does not move<\/strong><\/p><ul><li><span data-contrast=\"auto\">Check the connections: ensure STEP and DIR are correctly wired between Arduino and the driver.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><li><span data-contrast=\"auto\">Check the power supply: the motor must be powered externally (e.g., 12V), not via Arduino.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><li><span data-contrast=\"auto\">Check GND: all GNDs (Arduino, power supply, driver) must be connected together.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><\/ul><p><span data-contrast=\"auto\">\u00a0<\/span><\/p><p><strong>Motor vibrates but doesn\u2019t rotate<\/strong><\/p><ul><li><span data-contrast=\"auto\">Incorrect motor wiring: ensure that the two coil pairs of the NEMA 17 are properly connected. You can identify them using a multimeter (each pair shows electrical continuity).<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><\/ul><p><span data-contrast=\"auto\">\u00a0<\/span><\/p><p><strong>Driver overheats<\/strong><\/p><ul><li><span data-contrast=\"auto\">Current too high: adjust the potentiometer on the A4988 to limit the motor current.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><li><span data-contrast=\"auto\">No heatsink: ensure a heatsink is present on the driver (and possibly a cooling fan).<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><\/ul><p><span data-ccp-props=\"{}\">\u00a0<\/span><\/p><p><strong>Motor moves erratically<\/strong><\/p><ul><li><span data-contrast=\"auto\">AccelStepper not used correctly: ensure stepper.run() is in the loop and called continuously.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li><li><span data-contrast=\"auto\">Values too high: try lowering max speed or acceleration.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><ul><li>Set the baud rate to <strong data-start=\"4204\" data-end=\"4212\">9600.<\/strong><\/li><li>Turn the potentiometer knob and watch the values change from <strong data-start=\"4278\" data-end=\"4283\">0<\/strong> to <strong data-start=\"4287\" data-end=\"4295\">1023<\/strong>.<\/li><\/ul><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will walk through the essential steps required to program an Arduino Uno to control a NEMA 17 stepper motor. We will also cover in detail how to correctly wire all the components involved, ensuring a reliable and safe operation of the entire system.\u00a0 \ud83d\udd0d What is a NEMA 17? The NEMA [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":2058,"comment_status":"closed","ping_status":"open","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[68,69,43],"tags":[95,94,59,84,67,83,87,82,66,91,93,92,64],"class_list":["post-1856","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-electronics","category-tutorials","tag-adc","tag-analog","tag-arduino","tag-c","tag-complete","tag-cpp","tag-guide","tag-ide","tag-learn-by-doing","tag-potentiometer","tag-resistance","tag-resistor","tag-tutorial"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to use a NEMA 17 with Arduino - Learn by Doing!<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino-2\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing ROS 2 Jazzy on Ubuntu 24.04: Step-by-Step Tutorial\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will walk through the essential steps required to program an Arduino Uno to control a NEMA 17 stepper motor. We will also cover in detail how to correctly wire all the components involved, ensuring a reliable and safe operation of the entire system.\u00a0 \ud83d\udd0d What is a NEMA 17? The NEMA [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn by Doing!\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-24T09:39:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-10T22:43:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Progetto-senza-titolo-14.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"How to use a NEMA 17 with Arduino\",\"datePublished\":\"2025-06-24T09:39:49+00:00\",\"dateModified\":\"2026-01-10T22:43:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/\"},\"wordCount\":817,\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp\",\"keywords\":[\"adc\",\"analog\",\"Arduino\",\"c++\",\"complete\",\"cpp\",\"Guide\",\"ide\",\"learn by doing\",\"potentiometer\",\"resistance\",\"resistor\",\"tutorial\"],\"articleSection\":[\"Arduino\",\"Electronics\",\"Tutorials\"],\"inLanguage\":\"es\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/\",\"url\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/\",\"name\":\"How to use a NEMA 17 with Arduino - Learn by Doing!\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp\",\"datePublished\":\"2025-06-24T09:39:49+00:00\",\"dateModified\":\"2026-01-10T22:43:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use a NEMA 17 with Arduino\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"name\":\"Learn by Doing!\",\"description\":\"Learn Robotics the fun way\",\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\",\"name\":\"Learn by Doing!\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"width\":512,\"height\":512,\"caption\":\"Learn by Doing!\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/\"]},{\"@type\":\"Person\",\"@id\":\"\",\"url\":\"https:\/\/learnbydoing.dev\/es\/author\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use a NEMA 17 with Arduino - Learn by Doing!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino-2\/","og_locale":"es_ES","og_type":"article","og_title":"Installing ROS 2 Jazzy on Ubuntu 24.04: Step-by-Step Tutorial","og_description":"In this tutorial, we will walk through the essential steps required to program an Arduino Uno to control a NEMA 17 stepper motor. We will also cover in detail how to correctly wire all the components involved, ensuring a reliable and safe operation of the entire system.\u00a0 \ud83d\udd0d What is a NEMA 17? The NEMA [&hellip;]","og_url":"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino-2\/","og_site_name":"Learn by Doing!","article_published_time":"2025-06-24T09:39:49+00:00","article_modified_time":"2026-01-10T22:43:34+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Progetto-senza-titolo-14.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"","Tiempo de lectura":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#article","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/"},"author":{"name":"","@id":""},"headline":"How to use a NEMA 17 with Arduino","datePublished":"2025-06-24T09:39:49+00:00","dateModified":"2026-01-10T22:43:34+00:00","mainEntityOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/"},"wordCount":817,"publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp","keywords":["adc","analog","Arduino","c++","complete","cpp","Guide","ide","learn by doing","potentiometer","resistance","resistor","tutorial"],"articleSection":["Arduino","Electronics","Tutorials"],"inLanguage":"es"},{"@type":"WebPage","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/","url":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/","name":"How to use a NEMA 17 with Arduino - Learn by Doing!","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp","datePublished":"2025-06-24T09:39:49+00:00","dateModified":"2026-01-10T22:43:34+00:00","breadcrumb":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#primaryimage","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Nema-17-2.webp","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/"},{"@type":"ListItem","position":2,"name":"How to use a NEMA 17 with Arduino"}]},{"@type":"WebSite","@id":"https:\/\/learnbydoing.dev\/es\/#website","url":"https:\/\/learnbydoing.dev\/es\/","name":"Learn by Doing!","description":"Learn Robotics the fun way","publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/learnbydoing.dev\/es\/#organization","name":"Learn by Doing!","url":"https:\/\/learnbydoing.dev\/es\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","width":512,"height":512,"caption":"Learn by Doing!"},"image":{"@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/"]},{"@type":"Person","@id":"","url":"https:\/\/learnbydoing.dev\/es\/author\/"}]}},"_links":{"self":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/comments?post=1856"}],"version-history":[{"count":45,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1856\/revisions"}],"predecessor-version":[{"id":5622,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1856\/revisions\/5622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media\/2058"}],"wp:attachment":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media?parent=1856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/categories?post=1856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/tags?post=1856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}