How to Organize Code

  Рет қаралды 64,247

Programming Electronics Academy

Programming Electronics Academy

Күн бұрын

Пікірлер: 60
@RobWhittlestone
@RobWhittlestone 2 жыл бұрын
NIce refresher for an old software engineer. Nice explanations. I haven't written code in over 20 years but have no problem staying with you. I cut my teeth on FORTRAN, ALGOL, FORTRAN 77, S-FORTRAN, Assembler from various machines, also embedded, Pascal, Turbo Pascal, ANSI 'C', COBOL, Visual Basic, JavaScript - and that's when I became a full time project manager. But it's important to know what the 'softies' are going through and what can go wrong. All the best, Rob in Switzerland
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks a ton for watching Rob!
@planker
@planker 2 жыл бұрын
Excellent. Lots to digest here. I have some printed sketches, I'll take a pencil to them and do some breakdown. Reverse engineering is how I've been doing this, nobody has thought me. You are doing Ok!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks!
@sanamandingra
@sanamandingra 5 ай бұрын
You just established my workflow forever... Thank you!
@programmingelectronics
@programmingelectronics 5 ай бұрын
Great! Best of luck!
@jumadhaheri
@jumadhaheri 2 жыл бұрын
Well prototype functions is something new to me, fantastic educational video, thank you
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much for watching -Glad it helped some!
@mr.goldenrod291
@mr.goldenrod291 2 жыл бұрын
Top of program, first comment is program purpose. Second comment(s) are the revision changes. I put my user-defined functions after loop() (and have not used prototyping.) Seems to make editing easier as I am paging up and down less. Otherwise, based on 30 years of programming, I organize my programs as you do.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much for this!! That’s definitely a great addition.
@mahmoodmohammad7241
@mahmoodmohammad7241 2 жыл бұрын
Excellent, I like your way of teaching from scratch. Thanks
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks a ton!
@HollyHertig
@HollyHertig 10 ай бұрын
Thank you! You answered so many questions!
@avejst
@avejst 2 жыл бұрын
Great walkthrough of the process 👍 Thanks for sharing your experience with all of us 👍😀
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much for watching!
@KW-ei3pi
@KW-ei3pi Жыл бұрын
I always pick up something new, that may not be the main focus of the video. Like the side information on Function Prototypes. Thanks!
@programmingelectronics
@programmingelectronics Жыл бұрын
Thanks so much for watching!
@h-h1859
@h-h1859 2 жыл бұрын
Thanks for the video. Super helpful as always🙏❤️
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much!
@jon_raymond
@jon_raymond 2 жыл бұрын
This was really helpful. Perhaps you might consider an episode about using different tabs to help organize code?
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much, Jon! You must be reading minds because we just recorded a video on using tabs to help organize code, which will be released later this month. Thanks a ton for the suggestion; if you have any other video ideas, I would love to hear them!
@jumadhaheri
@jumadhaheri 2 жыл бұрын
@@programmingelectronics yes please my currant WIFI clock is 3000 lines of code and any adjustment also a nightmare in Arduino IDE
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks ​@@jumadhaheri !
@jamescullins2709
@jamescullins2709 Жыл бұрын
Do you cover using other processors other than Arduino, like EPS32, STM ?
@richardfurniss8091
@richardfurniss8091 2 жыл бұрын
That explains a lot, Thanks
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Glad it helped! Thanks a ton for watching Richard!
@exequielwouterlood5481
@exequielwouterlood5481 21 күн бұрын
Amazing tutorial!!
@programmingelectronics
@programmingelectronics 20 күн бұрын
Thanks for watching!
@cursoderobotica
@cursoderobotica 2 жыл бұрын
I love it!!! Cheers!!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much!
@ianbertenshaw4350
@ianbertenshaw4350 2 жыл бұрын
Excellent video! This is one thing i think the Arduino IDE does wrong - by allowing a programmer to stick their user defined functions below the loop and secretly compensating for it is a bit misleading to newcomers. It wasn't until i used platform io which is more strict that i realised what was going on . Any plans to make some videos on MicroPython ?
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much! Same for me, I really had no idea what was going on behind the scenes until I ran into an issue with not having a prototype written. Thanks for the MicroPython recommendation! No current plans but it’s something that’s has been interesting me for a while.
@pmanolak
@pmanolak 2 жыл бұрын
IDE well allow users to put their functions at the end. Actually the sequence does not matter. we do the same in other languages too. p.e. PHP, JavaScript.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
You're right, in most cases the sequence doesn't matter as the IDE should be auto-generating those functions prototypes for you.
@tonymai124
@tonymai124 2 жыл бұрын
I like your code font, would you tell the name of the font ?
@programmingelectronics
@programmingelectronics 2 жыл бұрын
I think it is just the Arduino IDE default which i believe is called "Monoco"
@joshuapitong899
@joshuapitong899 2 жыл бұрын
Thank you.😊🙌
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Glad it helped!
@DIYRobotGirl
@DIYRobotGirl Жыл бұрын
Isn't those neopixel legs need a 12v battery?
@warrenscorner
@warrenscorner 2 жыл бұрын
Awesome video! What if my sketch gets so big it’s hard to find my functions? I created a sketch that the loop got so busy it was hard to figure it out so I created functions to break it up. Then I had so many functions that it was hard to find the function I wanted. How do I create my own libraries? Then how do I insert the code to jump to the library?
@jovialcupid9687
@jovialcupid9687 2 жыл бұрын
U can make new tabs, no need for library
@programmingelectronics
@programmingelectronics 2 жыл бұрын
We have a video coming out soon about adding tabs in the Arduino IDE to help organize code better - this is a different approach than creating a library, but I think still pretty helpful depending on the use case. If the functions are all related and share/act on similar data, then making a C++ class may be the way to go.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Tabs are great! Thanks for adding this.
@RixtronixLAB
@RixtronixLAB 2 жыл бұрын
Creative video, thanks for sharing it :)
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much!
@ZookeeperJohnG
@ZookeeperJohnG 2 жыл бұрын
Super helpful!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks! Glad it helped!
@takatamiyagawa5688
@takatamiyagawa5688 2 жыл бұрын
I was kind of expecting a guide on how to break up code into multiple .cpp and .h files, but I guess that just amounts to a rehash of the tutorial on the arduino site on writing your own library, and it's effectively C++.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
On a slightly similar vein (but definitely different), we do have a video coming out about using tabs in the Arduino IDE to help organize code. When you add a tab, it creates an additional .ino file in the sketchbook folder and can help with organization.
@kabandajamir9844
@kabandajamir9844 2 жыл бұрын
So nice
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks!
@0x8badbeef
@0x8badbeef Жыл бұрын
Arduino appears to be an exception to C. It surprised me I can put a function below where it is used, even without prototyping.
@programmingelectronics
@programmingelectronics Жыл бұрын
The Arduino IDE has a build process that automatically creates prototypes for you (but sometimes it fails ;), which is why I usually always create prototypes for my functions. Thanks for the comment and for watching! arduino.github.io/arduino-cli/0.20/sketch-build-process/
@FioBrio
@FioBrio 2 жыл бұрын
You should use Arduino IDE 2.0
@programmingelectronics
@programmingelectronics 2 жыл бұрын
The Arduino IDE 2.0 is great! I love code completion, the movable serial monitor window, and moveable error console (among many other things). But, I am still having an issue with a lag in the serial monitor. When that gets worked out, I will probably make the switch. What I still like about Arduino IDE 1.0 is that it is really simple, which can be a huge advantage for beginners.
@sandwon
@sandwon 2 жыл бұрын
How do I install into my library? it is not in there.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Great question! If you go to tools > library manager and then search for the FastLED library you can one click install it there.
@sandwon
@sandwon 2 жыл бұрын
@@programmingelectronics Found it .Thanks
@programmingelectronics
@programmingelectronics 2 жыл бұрын
@@sandwon Great! Glad that helped!
Using Arrays with For Loops
17:24
Programming Electronics Academy
Рет қаралды 33 М.
Arduino MASTERCLASS | Full Programming Workshop in 90 Minutes!
1:25:31
Programming Electronics Academy
Рет қаралды 2,6 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 49 МЛН
Optimizing Arduino Code: no setup(), no loop() ⛔
9:27
Wokwi
Рет қаралды 208 М.
Arduino MASTERCLASS | How to Use Control Structures PART 6
21:39
Programming Electronics Academy
Рет қаралды 33 М.
How to Use Arduino Interrupts The Easy Way
33:28
Rachel De Barros
Рет қаралды 90 М.
Arduino Sketch with millis() instead of delay()
14:27
Programming Electronics Academy
Рет қаралды 231 М.
Using tabs to organize code with the Arduino IDE
12:18
Programming Electronics Academy
Рет қаралды 60 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 3,2 МЛН
ESPNOW for beginners! #ESP32 #ESP8266
35:09
Programming Electronics Academy
Рет қаралды 153 М.
Arduino UNO R4 Lesson12 - millis Function | Handling Multiple Tasks | Non-Blocking Code
23:38