Progetto Arduino

0 views
Skip to first unread message

Ariadna Parrent

unread,
Aug 3, 2024, 5:47:41 PM8/3/24
to cajugdyli

First of all it is great a pleasure for me to finally join in this illustrious community. I have found out about Platformio project on January of this year and ever since have been using it for many of my arduino projects. I use the Atom Text editor which I found to be extremely easy and intuitive to learn and use.

When I write codes in Arduino IDE, I can split the function bodies from the main ino files into discrete files following a sequential alphabetical naming scheme viz. A.main , B.pid, C.motor etc etc. When I hit the compile button, arduino compiles all these files and their associated header files without any error. Also the other ino files are capable of recognizing public variables, function calls written in libraries by other users installed into the Arduino IDE.

But in platformio, say I make the above files as such, main.cpp, pid.cpp, motor.cpp numerous errors are thrown including missing variable declarations from other libraries, for instance tft declaration of Adafruit GFX library is not recognized in other cpp files EXPECT in the main.cpp file.

Hence though I am not an expert in this subject matter, I strongly believe the platformio community/team should make ONE DEFINITIVE TUTORIAL to teach us less experienced programmers on how to create a multifile arduino project which will do the following

And a header-file (.h) with the function prototype and the struct definition. Arduino.h has to be included so you can use the variable type String. To clean up your project directory you can put the header-file in the include-folder while the source-file (.cpp) should be in the src-folder.
myhelperfunctions.h:

I totally agree. My programming discipline is questionable. I have a lot of multiple .ino projects and I am having a real struggle with getting a clean and manageable structure in Platformio.
At the moment, the Arduino IDE makes them far more readable.
For native C++ programmers, I guess the structure is second nature. For migrants from Arduino, it needs a better explanation - please?

I found that once I had a project working in platformIO that it was easy to navigate to, say a function, because they are all listed. However, I went back to the Arduino IDE for now because I can be get the job done much easier and quicker.
When I next try platformIO I plan to move the code from multiple tabs into one main tab, import that to platform.IO and get it running then maybe break it down into separate .ccp and .h files.

For Bill, he found using a tape measure to be less accurate as he would have liked. So to solve this problem, he used Arduino to create his very own linear actuator stop, which can measure lengths with an accuracy up to the thousandth of an inch!

Yes, typically you would have to use a tape measure and pencil to mark a spot, clamp a block to act as a stop, then do a sample cut. Then you would have to move the stop if it were not positioned correctly. With this positioner, the first cut is accurate.

Well, I saw an article in a magazine that showed an Arduino board being used to control a wood router position. I had never even heard of an Arduino before reading that article, and it looked very interesting and affordable.

I work in a factory that uses commercially available linear actuator position stops. They work great but can cost anywhere between $6,000 to $10,000 each. I thought that with the Arduino, I could maybe make a much cheaper version, so I bought an Arduino starter kit off of Amazon, just to get my feet wet.

I made the next version with servo motors. This fixed the issue with the missed steps. The first several positioners I made were directly driven from the motor to the pulley driving the belt actuator.

Since then, I have since added a gearbox between the motor and pulley with great results. Now, I am able to use a smaller powered motor. My next goal is to improve the user interface from a stick-on keypad with a small LCD screen to a 7-inch touchscreen.

After making 6 actuators I wanted to try and make one with a touchscreen. I knew it was going to be a lot more programming, but I was up for a challenge. After about a month of trying to make it work, I realized how big a challenge it was.

The screen needed to be programmed for every little detail shown on the screen and after I got the look I wanted, I was at about 600 lines of code. When I tried to make the buttons actually work I learned it was probably going to take thousands of line of code to work.

I knew I had to find an easier way, so I found the Nextion touchscreens and tried them (which made such a huge difference). It still took me a while to make it look and work the way I wanted, but it was so much easier and with way fewer lines of code.

Pattern Sewing and pattern cutting are changing the way mass market products are made. The quality in workmanship is stunning. Same thing in screen printing screen production and embrodery. Because the machine head can move in both the x and y plane at the same time this creates a near infinite number of positions inside a finite space.

This creates precision manufacturing processes that can create made products here in the usa that can compete with same products made in china. The demand and need for precision positioning in cutting and sewing has increased dramatically. Wilcom hatch in embrodery and circuit in home based pattern cutting are example companies and their are many others.

This project suggests small computers, plus inexpensive cam software can be developed here in the United states and used to compete with expensive cam technology being developed overseas in forien markets by very smart people.

It is a belt drive actuator. I bought the actuators and then modified them as they came with a stepper motor originally. I have added a servo and gearbox to the actuators. The problem with converting the actuator from a stepper motor to a servo I had was that the stepper motor shaft was directly connected to the pulley for running the belt. I took the stepper motor apart and machined the shaft down in order to connect it to a gearbox and servo. I also made the mounting for the gearbox from the outer case of the stepper motor. I have since been able to order the actuator from the manufacturer without a stepper and with the gearbox already installed along with the mounting so all I have to do is install a servo motor. It has an accuracy of a couple of thousands of an inch.

Ciao Bill, Progetto molto bello. Visto che sono riuscito ha compilare il codice, voglio provare a realizzare questo progetto. Chiedo se possibile avere uno schema elettrico per il collegamento del motore.
Grazie.

Questo progetto lo dedico ad un amico che mi segue su Youtube e che, da diverso tempo, mi aveva chiesto di realizzargli un distributore automatico di croccantini per i suoi 3 cani (food-dispencer). Beh...

Quando facendo ordine nel tuo magazzino di componenti elettronici, trovi un display Nextion cosa fai non lo utilizzi? Non ricordavo neanche di aver acquistato questo fantastico prodotto. Dico fantastico perch i display Nextion, a...

Il 31 progetto della rubrica 100 Progetti con Arduino Uno un mini braccio robot controllato da joystick e pulsanti. Per replicare questo sistema bisogna prima di tutto scaricare e stampare i file STL...

Il 30 progetto della serie 100 Progetti con Arduino Uno dedicato a tutte quelle persone che in privato mi hanno chiesto se fosse possibile utilizzare il 29 progetto come audio-meter. Ovviamente la mia...

Utilizzare un display Lcd diventata una consuetudine nei miei progetti con Arduino. Mi permette di avere sotto controllo lo stato di funzionamento del sistema senza dover usare il terminale seriale, e rende ogni...

Per accontentare un utente che mi segue su Instagram (credo dovrei dire follower), il 28 progetto della serie 100 Progetti con Arduino Uno : un metronomo digitale. Ovviamente il sistema che sto per mostrarvi...

This Smart Home Learning Kit based on the Arduino platform is newly rolled out by Keyestudio DIY Robot Co. Ltd. It simulates the real smart home and demonstrates the cozy and comfortable life for people.
This system adopts PLUS main control board and multiple modules, including 1602 LCD, photocell sensor, analog gas(MQ-2) sensor, PIR motion sensor, yellow LED, servo, steam sensor and Bluetooth.
In fact, Bluetooth controls everything in smart home: light intensity, humidity, flammable gas concentration, doors openning and closing. Everything is controlled via APPs on smart phones/IPad and will be displayed on 1602 LCD in real time.
We totally provide 3 programming languages: C language, Mixly and Scratch. These languages hit the top list in programming, which is easy and convenient to use and understand.

There are two versions for WINDOWS system, one is installed version, another one is download version, you just need to download file to computer directly and unzip it. These two versions can be used normally. Choose one and download on your computer.

A- Used to verify whether there is any compiling mistakes or not.
B- Used to upload the sketch to your Arduino board.
C- Used to create shortcut window of a new sketch.
D- Used to directly open an example sketch.
E- Used to save the sketch.
F- Used to send the serial data received from board to the serial monitor.



We usually combine Arduino control board with other sensors, modules and multiple sensors, which is difficult to wire. Conversely, this sensor shield cover this problem, you just need to stack on keyestudio PLUS control board when you use it.

Most people omit comments, starter should develop a good habit of looking through code. Firstly, check comments. They contain the provided information and do help you understand test code quickly. Secondly, form the habit of writing comments

According to comments, we will find that author define the D13 pin mode as digital output in setup() function. Setup() is the basic function of Arduino. It will execute once in the running of program, usually as definition pin, define and ensure the variables.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages