Can DeepSeek R1 Actually Write Good Code?

  Рет қаралды 164,721

Garage Tinkering

Garage Tinkering

Күн бұрын

Пікірлер: 568
@Damaniel3
@Damaniel3 11 күн бұрын
Compared to the other models, this is actually impressive. The internal debate it has over how to implement the solution is actually more interesting than the solution itself.
@GarageTinkering
@GarageTinkering 11 күн бұрын
I actually agree. I like seeing behind the curtain
@robouden
@robouden 11 күн бұрын
@@GarageTinkering. I the same expanse with DeepSeek. Much nicer way to work “together”. Even running it locally in with the 7B version..
@robouden
@robouden 11 күн бұрын
Interesting difference with ChatGPT is that according to me, DeepSeek takes no compliments..:) . ChatGPT often “feels” like it appreciate compliments. But DeepSeek does not seem to “enjoy” compliments..:)
@tyrannosauruswrecks5904
@tyrannosauruswrecks5904 11 күн бұрын
​@robouden could it be a cultural difference? I know in a lot of Asian cultures, you are supposed to deny it if someone compliments you. Accepting compliment out right is seen as arrogant. Maybe the data they trained from had cultural influence on the model.
@Gatrehs
@Gatrehs 10 күн бұрын
@@tyrannosauruswrecks5904 That would make sense, it's one of the reasons ChatGPT prefers compliments/thank you's/please's and performs better with it.
@tsalVlog
@tsalVlog 10 күн бұрын
to be fair to the model, even some senior devs can sometimes struggle with debounce algorithms. this is actually better performance than I'd expect and am impressed.
@JTGROT
@JTGROT 12 күн бұрын
Wow I love how in depth this is. I like that it writes out reasoning so if there are errors it is easier to point them out. I’m impressed
@GarageTinkering
@GarageTinkering 11 күн бұрын
I like that too. I also like how that potentially deepens your understanding of why a decision has been made, rather than just spitting out answers
@newmonengineering
@newmonengineering 11 күн бұрын
Actually ChatGPT does this as well but it doesn't print it out. It does have an internal reasoning bit. But because it doesn't show that, you can't as easily correct it. When you have the decision process you can point out it's flawed methods and it can correct itself better. I think showing the decision tree is significantly better so we can nudge it in the right direction better by correction of the decision tree. I'm glad to see DeepSeek because it has some fresh perspectives and will definitely change the Ai market.
@envynoir
@envynoir 11 күн бұрын
@@newmonengineering because the normies would get overwhelmed by that, but i agree with you
@aaronperl
@aaronperl 11 күн бұрын
@@JTGROT the first time I asked it something I didn't know it was giving its thought process, I thought it was giving me the answer. I thought it sounded like a grade-school book report
@draco76xx
@draco76xx 11 күн бұрын
@@GarageTinkering Great video, it's good to see "how" Deepseek made the decision to implement the solution, furthermore, it's "documented" their thinking process that we can traced back the error, rather than spitting the answer out like a "Black Box". And the $$ it cost is also a big difference. This video is like an "Senior" with lots of experience guiding a potential high flyer junior not to over think. 😂
@leppie
@leppie 11 күн бұрын
Deepseek overthink just as much as I do. This might be a good thing for me as a supplement.
@raydosson2025
@raydosson2025 11 күн бұрын
My coding knowledge is limited but this was a very entertaining watch. Thanks!
@wybird666
@wybird666 11 күн бұрын
FYI: the other AI chat bots also perform this inner monologue and rationalisation of the problem - they just hide it from you (or only provide a snippet) because exactly how they work is a trade secret. One of the key differences of deepthink is the openness. Numberphile have a good video on this.
@jimbeam9504
@jimbeam9504 10 күн бұрын
Another massive difference is the model they managed to create without the massive cost. OpenAi was almost certain that no one could compete due to the financial requirements.
@Leif_YT
@Leif_YT 9 күн бұрын
I love how open the process it. I would consider myself a beginner programmer for my ESP Projects and seeing the thought process can help a lot to understand the code snippets better. Sometimes I also like to use AI to ask it to explain code other people have written to me.....that can be so helpful. It's impressive when AI can do work for us, but I think it's even more impressive when it can also be like a personal teacher to help understand things better.
@Songfugel
@Songfugel 8 күн бұрын
Not all, depends on the model, but you raise a good point
@ShawnFumo
@ShawnFumo 4 күн бұрын
I think the only ones right now that also do this are o1/o3 from OpenAI (and the mini variants), a Thinking version of Gemini Flash 2, and Kimi’s k1.5 (another Chinese company). One way to tell is that if the model immediately starts giving you an answer, it can’t have a bunch of reasoning happening beforehand. And you can induce some of this on your own via prompting (telling it to go step by step etc) but it won’t be as effective as with these reasoning models that were specially trained for it.
@peterweber79
@peterweber79 10 күн бұрын
I asked a local ollama deepseek 32b installation the same question (+ spelling mistake 😁) and I also got a program code that could work (no nano on hand to verify).. very impressive. PC amd ryzen 5800, 32gb ram RX6800XT with 16gb, total response time ~3 minutes.
@yewhanlim8916
@yewhanlim8916 10 күн бұрын
Teachers like to see a student's thought process rather than the answer.
@ridhom2
@ridhom2 11 күн бұрын
If my understanding is correct, the original debounce code should work, it just expect the user to press and hold the button for some amount of time. The code will try to read the button several times, during the first change and then after the debounce delay time has passed, if the debounce delay time has passed and the button is still pressed, then it will register the button press. Anyway, nice video!
@GarageTinkering
@GarageTinkering 11 күн бұрын
Hmmm yeah, you might be right. It's still a failure as it's not what was asked for, but looks like potentially a different kind of failure
@Alaric323
@Alaric323 11 күн бұрын
@@GarageTinkering Would you have considered it valid if it TOLD you how to use the program (I know it wouldn't be what you requested at that point)? Like, if at the end of the code it said "this is programmed so you need to hold the button for x amount of time"?
@GarageTinkering
@GarageTinkering 11 күн бұрын
@@Alaric323 Yes. I think that would have been valid, because it came with instructions. And at that point I would have said "that's not what I want, I want x" and allowed it to redo it before the first test
@fransmurati2370
@fransmurati2370 11 күн бұрын
Not over thinking, perhaps analysing, perhaps it also believes, asumption is the mother of all f-ups
@egonthefish4614
@egonthefish4614 11 күн бұрын
I wouldn’t call it a failure per say. The whole debounce serves to distinguish a "wanted" change of state from a random oscillation, the love game of capacitance and inductance. I would have liked to see whether simply reducing the static delay from 50 to 25 would have been enough to capture fast clicks. The generated code looks familiar to phrases used within the bounce2 library. If both if-statements would be combined in one if-else if statement it would match one codeblock.
@LuMaxQFPV
@LuMaxQFPV 10 күн бұрын
Yes. I've been going crazy writing all kinds of code. It is the best I've used. Few errors, and when there are errors, it's very easy to communicate with, and corrections are effective.
@charlesscholton5252
@charlesscholton5252 10 күн бұрын
I have noticed and experience the same thing.
@haha-eg8fj
@haha-eg8fj 8 күн бұрын
How can you use so effectively? 7 out of 10 times the server is busy for me and I can’t get an answer from it. Did you use the API?
@charlesscholton5252
@charlesscholton5252 8 күн бұрын
@@haha-eg8fj I have been getting the same thing at times. I have had to toggle off deepthink and websearch, to get past it. The results without DeepThink and search have still been pretty amazing. Deepseek has been under various kinds of attacks trying to DDos it and more. A lot of this information is provided in their Server Status and publicly posted issues listings.
@ShawnFumo
@ShawnFumo 4 күн бұрын
I haven’t tried for Arduino, but people generally also like Claude Sonnet 3.5 (new version) for coding, and the new o3-mini should be pretty good as well (especially the “high” version, but the usage limits are a lot less)
@nikivan
@nikivan 11 күн бұрын
Wow, great presentation. This channel should have a lot more subscribers.
@GarageTinkering
@GarageTinkering 11 күн бұрын
I agree lol. I'm still pretty new, but I'll get there! Appreciate the kind words
@vincentdesjardins1354
@vincentdesjardins1354 11 күн бұрын
@@GarageTinkering Agreed as well. Just subscribed. Please keep 'em coming !
@Dezzy_3Dots
@Dezzy_3Dots 10 күн бұрын
I'm a longtime PC builder and user, and have been interested in learning some code writing to mess around with Arduino. This was a really well explained and straightforward look at AI to help with that and this has sharpened my interest muchly - an old aussie...
@floydwolverton2504
@floydwolverton2504 10 күн бұрын
I posed this to it: Develop an Arduino program that uses an 7-segment display to count 0 to 7. It created an impressive program and it decided to use a common cathode display and picked correct current-limiting resistors, etc. and gave me the code PLUS these comments: How It Works: Pin Setup: Segments a to g are connected to Arduino pins 2-8. Digit Patterns: The digitPatterns array defines which segments to light up for each digit (0-7). Loop Logic: The program cycles through digits 0-7, updating the display every second. Notes: Add 220Ω resistors to each segment pin to protect the LEDs. Adjust the pins in segA-segG if your wiring differs. For a common anode display, swap HIGH and LOW in the digitPatterns array. Let me know if you need help with wiring or troubleshooting! 😊 I was surprised by the decent-looking code. It should work.
@lifeshacks3995
@lifeshacks3995 7 күн бұрын
I have used it a few times now and it has found libraries I didn't even know about! I found it to be of great help. I found it to be able to Interface many chips to the ESP32.
@RandomTorok
@RandomTorok 11 күн бұрын
When I first learned of ChatGPT, I came home from work and created an account with OpenAI. I thought I'd test it's ability to write code. I told it to write a windows program in C that said Hello World. It spit out about 90 lines of code that failed to compile with some kind of error message. I didn't bother to chase the error message I just asked the same question a second time. This time it gave me 50ish lines of code that also failed to compile but this time no error message. I then asked the same question a 3rd time and this time, I got 12 lines of code that compiled and ran. Running the executable gave me a little windows dialog box that said Hello World and an OK button that when pressed closed the window.
@SonOfRamenEgg
@SonOfRamenEgg 10 күн бұрын
So now you're the for loop?
@bebechou42
@bebechou42 10 күн бұрын
lol
@Clydiie
@Clydiie 9 күн бұрын
Have you tried it recently
@dante0817
@dante0817 8 күн бұрын
Nice to hear that story of yours.
@foreignwarren7361
@foreignwarren7361 4 күн бұрын
​@@Clydiieits brilliant I love it, as somebody with little experience I was able to build a basic Web page, install a Linux vm host it on apache and get a login going to the database all using chat. 😂
@Millsy.g
@Millsy.g 6 күн бұрын
For people with ideas they want to prototype, this sort of thing is huge. It lowers the barriers to entry immensely. You would be minimum $200-$500 to outsource a bit of coding to a 3rd party for nearly anything. And getting revisions done gets even more expensive. Being able to say " i have this hardware, give me some code to do X" is great. Even if you have to spend way more time than a good coder would take to get it working, you go from being unable to do it at all, to taking a bit of time.
@timcorso6337
@timcorso6337 9 күн бұрын
I just used Claude to build me a sophisticated autonomous GPS data logging application, using a Lilygo T-Beam. I knew nothing about the hardware and my programming skill non existent, but I was able to code the GPS, the IMU, as well as the SD card reader and the OLED display. Quite astonishing that I (Claude) was able to write over 2500 lines of code. What I really liked was the ability to show Claude photos of the badly formatted screens that it gave me for the OLED and from the photos I took it generally sorted things out. Also I showed it the GPX files from the data logger and again it was pretty good at analysing issues while debugging.
@haha-eg8fj
@haha-eg8fj 8 күн бұрын
I think Claude is the strongest at coding.
@ShawnFumo
@ShawnFumo 4 күн бұрын
@@haha-eg8fj I’ve seen some people using tools like Cline that have separate planning and coding modes, are using R1 for the planning and Sonnet for the execution, which is an interesting idea.
@wingman57-c6v
@wingman57-c6v 10 күн бұрын
Thank you sir! I have learned so much from the few videos I have watched on your channel. Now I have to figure out how to use the DeepSeek product on my own.
@Cam2Art
@Cam2Art 11 күн бұрын
Impressive demo, amazing that these AI tools have obviously trained on such a wide universe of code libraries and as built applications.
@GarageTinkering
@GarageTinkering 11 күн бұрын
Going to be even more interesting when people build specific versions on this framework for certain code bases and make them super focused!
@paulstimpson830
@paulstimpson830 10 күн бұрын
Be careful what code you ask LLMs to debug or generate. Public LLMs usually train from the questions you feed them. If you ask one to debug some secret-sauce, proprietary code, it may then offer your code as a solution to someone else who asks a similar question. There is a known instance where someone at a name-you-know smartphone maker asked a public LLM to help them debug some of their secret-sauce code and the LLM then spat that code out when their competitor asked it to generate code that did the same thing. Our company pays for private, siloed LLMs for just this reason
@akm3726
@akm3726 11 күн бұрын
That was quite a video. I'm really impressed with what DeepSeek did and how it did it! Thanks.
@c6jones720
@c6jones720 11 күн бұрын
This is demonstrates why we'll probably still have our jobs for a while yet.
@aquacruisedb
@aquacruisedb 11 күн бұрын
Yeah agreed, safe for a few more weeks yet.... 🤣
@mikea8858
@mikea8858 10 күн бұрын
It's not AI for dummies yet.... But new edge devices will change that.... It's like working with a really smart programmer who's never had Todo maintenance... Want to see how it handles TDD
@mikea8858
@mikea8858 10 күн бұрын
Ask it to make an AI that makes UI on the fly....
@mikea8858
@mikea8858 10 күн бұрын
Needs an intuition processing unit
@SrDelbioLima
@SrDelbioLima 9 күн бұрын
I like your optimism. lol
@SansNeural
@SansNeural 11 күн бұрын
"It seems to overcomplicate things" People tend do that too. And in either case, the more complicated the logic, the more likely it is to fail. In the '90s the small co I worked for needed a couple more industrial machine automation programmers. We had trouble identifying candidates (mostly fresh ComSci grads) by just their resume stated skills, so I devised a real world test for controlling a machine's moving shield. The control logic for safely opening and closing the shield requires "two-handed, anti-tiedown" logic where the machine operator must hold a COMMON button with one hand and operate an Open or a Close button with the other. The two buttons required to Open or Close must be pressed and held within 500ms of each other to be valid. There were also limit switches to show when the shield was closed and to show if an object was impinging the shield. Our test provided pre-defined IO calls and timer definitions with examples of how they're used. We got candidate solutions that ranged from 30 lines of C code 3 printed pages of code. The actual solution (no we weren't trying to get free work out of candidates) already in real life use was 9 lines of C code.
@666-fire2
@666-fire2 10 күн бұрын
Yeah it over complicates things alot, to be honest I just like using it for the deep think function helps me find bugs faster and generally its like having a second brain or opinion on a very specific matter.
@impactodelsurenterprise2440
@impactodelsurenterprise2440 10 күн бұрын
That 9 lines of code was perfected over a period of trial and error. To get a candidate to do the same on the 1st try on the fly is unfair unless he or she had prior experience in a similar application.
@SleepyBoBos
@SleepyBoBos 10 күн бұрын
Just curious, was the code wrapped in unit tests or some sort of test rig to ensure operation? How did you test code worked? I'm an ex developer
@mikea8858
@mikea8858 9 күн бұрын
@@SansNeural but how long did those 9 lines take to write?
@mikea8858
@mikea8858 9 күн бұрын
@@666-fire2 extreme pair programming without pulling another resource from something else makes sense to me. If only it were simple to train on domain knowledge and coding standards?
@DefaultFlame
@DefaultFlame 11 күн бұрын
Thank you for the thorough testing.
@zavatone
@zavatone 10 күн бұрын
This is intriguing. AI writing code terrifies me because of what happens when it goes wrong and who knows how and why to fix it. We have enough f-ups in software without AI creating problems that no knowledgeable expert is able to understand and repair. I made my career solving the problems created by offshore programmers and architecting to make sure that they don't create these f-ups. The reality is NOT when it works as expected, but WHEN it effs up, how minimal is the damage, how can you get someone to understand and fix it and making sure that the team NEVER EVER does that again. Business is all about minimizing risk. With AI coding, there is no expert to prevent this risk and no expert to identify, understand, repair the issue and institute a policy to make sure it never happens again AND to add QA steps to make doubly sure the issue will be caught if it does sneak through in future updated. It terrifies me.
@raymond_luxury_yacht
@raymond_luxury_yacht 8 күн бұрын
No they don't! Debugging is gard
@ferfromla
@ferfromla 11 күн бұрын
Wow, this thing is really a step forward. For the most part, it works; for people who know what they are doing, this will cut work time at least by half. I also suspect that it learns what it did not do when making corrections and is less likely to make the same mistake again. I am impressed and heartened that it is open source. That is good for all of us.
@GarageTinkering
@GarageTinkering 11 күн бұрын
The open sourceness is what I really like too. It's why I share everything I create on this channel. Empower the world!
@estranhokonsta
@estranhokonsta 11 күн бұрын
The "learning" you mentionned is done inside the context of the chat. Once you initiate a new chat it will always be using the same unmodified model. That is, unless you manage to retrain efficiently the model with your specific content. That last part is normally unrealistic for most of us. But it seem that with deepseek, they claim that this may no longer that way. That is the why of the deepseek clamor.
@v12alpine
@v12alpine 11 күн бұрын
@@estranhokonsta so, don't ever bother asking it to code pushbuttons without bounce2. lol
@ShawnFumo
@ShawnFumo 4 күн бұрын
@@estranhokonsta Well DeepSeek won’t learn either. At a fundamental level, it is still the same kind of LLM, but the difference being it is trained to have longer and better chains of thought before giving the final answer. But you still could prompt it to do things a certain way or let it know mistakes it commonly makes. If using a tool using it through an API, often you can modify the system prompt or have a prompt template of some kind where you could add that info to pass over all the time.
@SvenHeidemann-uo2yl
@SvenHeidemann-uo2yl 10 күн бұрын
Looks very useful for someone who is inexperienced, since following its reasoning, the user can get a better understanding of the problem/solution and therefore might figure out how to problem solve, if something doesn't work.
@Frankie_Freedom
@Frankie_Freedom 11 күн бұрын
Wow this is pretty good. I can definitely see this as a good way to help learn, because it's writing out its thought process. I think helps learn things because helps you on how to think about problems
@GarageTinkering
@GarageTinkering 11 күн бұрын
Absolutely agree
@codures
@codures 11 күн бұрын
Unfortunately, this is not quite ok because the IA will teach us (hence influence and model) how we think and perceive. This is the biggest problem with IA: it inferences us instead the other way around. How would a world modelled by IA look like, given that everyone needs tokens to learn (from more or less biased IAs)? Maybe, a better option would be to write the tasks needed (with low quality code but great readability) and let the students' reflection and reasoning do the magic. Wouldn't this way of "learning" be more reasonable (although slightly difficult)?
@codures
@codures 11 күн бұрын
​@@GarageTinkering great demo man! Btw I love your gauges, I also coded with lvgl/squareline in the past.
@nikthefix8918
@nikthefix8918 11 күн бұрын
@@codures Yes, I wonder how well the AI can turn pseudo code into working code given very few other prompts.
@codures
@codures 11 күн бұрын
@@nikthefix8918 my take is that if one specifies the desired language (c*, python,...), it'll do it fingers in the nose.
@BerndSchmitt-Martinique
@BerndSchmitt-Martinique 10 күн бұрын
Absolutely stunning !!! My dog is getting impatient, because i couldn't leave your video, until watching till the end and reading some comments. But now it's my dogs turn. Greetings from Germany....i am a 74 year old retired engineer with the hobby of programming microcontrollers. I can follow and understand the code easily and also how the AI was thinking through the whole process........ But i have no clue, how this task " analyzing and coding " can be achieved by a software system.....NO CLUE !
@GarageTinkering
@GarageTinkering 10 күн бұрын
Funnily enough my dog was getting super impatient when I was filming it because she wanted to walk and I just wanted to finish.
@BerndSchmitt-Martinique
@BerndSchmitt-Martinique 10 күн бұрын
@@GarageTinkering i just subscribed...interesting stuff. editing ......now that i have subsribed , there are a lot of interesting GARAGE videos popping up. what i like too.... ESP32-S3 - all kind of modern displays like the round ones. I am using big ones 7" with capacitve touch to realize my Flight Panels. They extract important data from the flightsimulator MSFS2020 and let me interact and control the plane by touch... Until now i was strictly against LVGL for micro-controllers - but meanwhile i am thinking of changing the whole display in a professional looking one - powerde by LVGL. Lets see. btw .....My dogs name is ARKO .
@X400DYL
@X400DYL 8 күн бұрын
Loving the channel, Subbed!
@v12alpine
@v12alpine 11 күн бұрын
I use delay loops to write to EEPROM. Only write when it's been say, 5 seconds since the last state change. There was an Audi factory stereo back in the day that wears out the EEPROM due to the volume knob; it was writing the state for each click of the encoder lol.
@GarageTinkering
@GarageTinkering 11 күн бұрын
Oh boy!
@ghwizz
@ghwizz 11 күн бұрын
Let's not forget Tesla and logging everything they did the same!
@heroslippy6666
@heroslippy6666 10 күн бұрын
oh nooo
@schack
@schack 11 күн бұрын
Great video, great test, thanks!
@derduebel
@derduebel 11 күн бұрын
For me it runs locally and is currently programming its own agents. After that it can help vectorize a database. We get on very well, because it thinks just as crazy as I Do. 😂
@davecreelman
@davecreelman 11 күн бұрын
Could you please provide a link to how you setup vectorizing for external data? I want to set this up, but it still feels like a quite complex process.
@ShawnFumo
@ShawnFumo 4 күн бұрын
For curiosity, which sized distilled model are you using?
@darwinboor1300
@darwinboor1300 11 күн бұрын
It seems that DeepSeek has shown us that once again, the factory is as important or more important than the product. They changed the AI building model (the facory) and got a comparable product at with less capital investment, less cost per product, and in less time.
@oliverschwarzen5774
@oliverschwarzen5774 11 күн бұрын
On what, with what Data, just a distilled AI Yasuke?
@PeterJamesMoments
@PeterJamesMoments 10 күн бұрын
I feel like DeepSeek has not only ridden on the back of success of the overarching AI industry but also has also distilled and backwards engineered its models from the highly financed AI companies. It feels like it most likely gives the illusion of performance at the cost of being more authenticity intelligent. Given the data driven nature of these models my concern would be how will deepseek be able to evolve unique and direct answers with limited access to new data in the western world. I don’t think this will be true for the current big AI players.
@throwitatthewall6289
@throwitatthewall6289 10 күн бұрын
Yeah, they didn’t create it they just used an already made AI to teach theirs.
@rezaulkarim7703
@rezaulkarim7703 10 күн бұрын
If you read the technical research paper on Deepseek R1, you can easily find that this LLM model works (it's internal mechanism) entirely differently than what is available out there. To try to label it as backwards engineered is a disservice to the researchers. Also the notion that "they didn't create it, rather used an already made AI" is false. Yes they used an already made AI which is their own developed LLM Deepseek V3 to train the Deepseek R1 Zero, which in turn used to train the R1. The only thing they used from the already available stuff online is the data (partially). They have user a method called Reinforced learning, which is a way where the AI teaches itself everything without any human interventions. The researchers used a training and reward system where the LLM tires solution to the problem and if got it right, it was given a reward. The data used was Synthetic data. Also R1 can be so efficient that not even the ChatGPT o1 can be because of how it works. It's an entirely new method where not all the parameters (internal neural networks) are all activated all the time, which is the case for every other model. Out of all the 671b parameters of R1 only 31b parameters are active at a time. It's a specialized approach that saves computer and energy.
@SleepyBoBos
@SleepyBoBos 10 күн бұрын
A factory is a good metaphor for breaking a problem into smaller steps and cooperation between processes (agents)
@bradzoltick6465
@bradzoltick6465 11 күн бұрын
Nice video. I like it that you used an Arduino sketch to test its capability. Just amazing.
@666ortiz
@666ortiz 3 күн бұрын
Thank you, this was an interesting & useful evaluation of seeing how the AI tackles a realistic and not-quite-trivial programming challenge.
@robwilkinson8622
@robwilkinson8622 10 күн бұрын
🤩great video! I'd love to see the result if you had included into the prompt "when you encounter a difficulty which causes excessive internal debate back up several steps and reflect and ruminate upon the work you have done before making another attempt at a solution" I have found that telling an AI to 'reflect and ruminate' on its output always results in a better outcome.
@dtcorzine
@dtcorzine 9 күн бұрын
@GarageTinkering, starting at 27:24 you explain that how the initial button press would set `lastToggleDebounce` to `millis()` and then the code immediately checks if `millis() - lastToggleDebounce` is greater than the bounce delay. You correctly point out that it "hasn't had a chance to be greater than the bounce delay", so the code in the `if` block doesn't execute. However, this is NOT the real problem. That behavior is intentional and entirely by design, because the whole point of the debounce logic is to wait for the pin value to stabilize for that delay time and the code shouldn't run before that. The intent is for the second `if` block to trigger on a LATER call to the function, after the delay time has elapsed, without a state change that would cause the debounce timer to reset. (The second `if` block could have been `else if` instead, which would have been functionally equivalent.) Actually the original debounce code is VERY close to working correctly! The real reason why the original code was completely broken (causing the buttons to do nothing) isn't because of that debounce delay test happening immediately after the timer reset code. It's because of a subtle design flaw that breaks the otherwise correct logic of this debounce algorithm. For reference, here is the code of that function as shown in your video, with the relevant variable declarations: ``` unsigned long lastToggleDebounce = 0; int lastToggleState = HIGH; void handleToggleButton() { int reading = digitalRead(TOGGLE_BTN); if (reading != lastToggleState) { lastToggleDebounce = millis(); } if ((millis() - lastToggleDebounce) > DEBOUNCE_DELAY) { if (reading != lastToggleState) { lastToggleState = reading; if (reading == LOW) { lightsOn = !lightsOn; updateLEDs(); saveState(); printState(); } } } } ``` To understand the actual bug here requires following the chain of logic: 1. `lastToggleState` starts as HIGH (meaning the button is not pressed) 2. When `handleToggleButton()` is called, it reads the pin and sets `reading` to HIGH (button not pressed) or LOW (button pressed) according to the instantaneous state of the signal on that pin. 3. If the button is not pressed, then `reading` is HIGH, which is the same value as `lastToggleState`. Therefore the first `if` block would not execute because the conditional test is false. Therefore, `lastToggleDebounce` is NOT reset and retains its existing value. 4. With the button still not pressed, the second `if` block WILL execute now if `millis() - lastToggleDebounce` is greater than the debounce delay. (Since `lastToggleDebounce` starts with a value of zero, this will be true except perhaps for the first 50 ms after power on.) However, the nested `if` block checks to see if `reading != lastToggleState`. Since both values are HIGH, this conditional test fails and the code inside that `if` block doesn't run. 5. When the button is pressed, the next call to `handleToggleButton()` will set `reading` to LOW (button pressed). 6. With the button still pressed, the first `if` block will compare if `reading != lastToggleState`. Since this time `reading` is LOW and `lastToggleState` is still HIGH, this conditional is true and the block of code runs, setting `lastToggleDebounce = millis()`. This is what should happen. The second `if` block doesn't run immediately, by design. 7. With the button still pressed, future calls to `handleToggleButton()` continue doing exactly the same thing each time, setting `lastToggleDebounce = millis()` and skipping the other block of code, which never runs while the button is pressed. 8. When the button is released, the future calls to `handleToggleButton() will set `reading` back to HIGH (button not pressed), which will again prevent the `lastToggleDebounce` time from getting reset. After the debounce delay time, the code in the second `if` block will run, but the nested `if (reading != lastToggleState)` condition will fail because `reading` and `lastToggleState` are both HIGH, so the rest of the code is skipped. The actual bug is that `lastToggleState` CAN'T change from its initial value of HIGH, because the `lastToggleState = reading;` line of code which changes the value only executes after the debounce delay, when `reading` and `lastToggleState` have different values. When the button is pressed, the values are different, but the `lastToggleDebounce` time keeps getting continually reset every time through the function, so the second `if` block never runs while the button is pressed because it's impossible for the delay time to elapse when the `lastToggleDebounce` time is getting reset EVERY time through the function. When the button is not pressed, the code stops resetting the `lastToggleDebounce` time because `reading` and `lastToggleState` are both HIGH. There is no possible way for this code to ever set `lastToggleState` to LOW because the code modifying that variable can only run when `reading` is HIGH. Hence, the buttons don't work. Moving the `lastToggleState = reading;` line of code into the first `if` block would break this impasse, because the first `if (reading != lastToggleState)` block would only run when the button status actually changes, saving the new state in `lastToggleState` and resetting the `lastToggleDebounce` time only when the button status changes, either from HIGH to LOW, or from LOW to HIGH. That's exactly when the debounce delay should begin, because the current state isn't stable yet and could be bouncing. When the state stabilizes for long enough, the debounce delay time will elapse and the second `if` block will run at the correct time after the debounce delay. However, at this point the `if (reading != lastToggleState)` conditional is guaranteed to fail because `lastToggleState` was just set to the value of `reading` if they started out different. Therefore, the buttons still wouldn't work. Removing that test WOULD cause the updates to finally run after the debounce time elapses, as they should. However, the update code would keep running constantly over and over again every time the function runs, for as long as the button remains pressed. Good luck controlling the state when it's being toggled on and off constantly every millisecond or so! So... why did I say that the original code was VERY close to working? Because it was. The logic of the debounce algorithm is solid. The fundamental design flaw is that it was trying to use `lastToggleState` for two different purposes, which are incompatible with each other. The first `if (reading != lastToggleState)` block needs `lastToggleState` to contain the last instantaneous button value so that it can detect every edge transition and reset the debounce timer instantly whenever it changes (or bounces). However, the SECOND `if (reading != lastToggleState)` needs `lastToggleState` to contain the last STABLE button value, so that it can detect the edge transition from HIGH to LOW for the initial button press (after the debounce delay). That's why it sets `lastToggleState = reading`, to make sure that the updates only run ONCE for each button press, no matter how long the button is pressed. The solution is simple. The original code needed to use TWO state variables to serve each of these purposes as intended, one for the instantaneous state (to detect bounces) and one for the stable state (to detect when to trigger ONCE for the button press). Compare the following code with the original code and you'll see that it's nearly identical: ``` unsigned long lastToggleDebounce = 0; int lastToggleState = HIGH; int currentToggleState = HIGH; void handleToggleButton() { int reading = digitalRead(TOGGLE_BTN); if (reading != currentToggleState) { lastToggleDebounce = millis(); currentToggleState = reading; } if ((millis() - lastToggleDebounce) > DEBOUNCE_DELAY) { if (reading != lastToggleState) { lastToggleState = reading; if (reading == LOW) { lightsOn = !lightsOn; updateLEDs(); saveState(); printState(); } } } } ``` I don't have the hardware to be able to test this code, but it should work correctly, debouncing the button presses as intended.
@sebastianrausch2261
@sebastianrausch2261 8 күн бұрын
Another corrective change would be this: +if (reading == lastToggleState) -if (reading != lastToggleState) This gives the expression " Millis() - lastToggleDebounce " the meaning " time since the button was read in the currently assumed state". Looking at the conditions again we see that we have 3 different cases: - reading is stable and time gets reset,thus the previous time doesn't matter - reading is unstable, time is less then denounce, thus no action taken - reading is unstable, time exceeds denounce, change of the assumed button state Those three conditions are perfectly met, even without the nested if statement.
@dtcorzine
@dtcorzine 8 күн бұрын
@@sebastianrausch2261 Wow! This is counterintuitive, but it works! It felt wrong, so I carefully analyzed and wrote an explanation of exactly what would happen step-by-step. After I finished the entire analysis, I accidentally reloaded this page and lost the entire writeup! Argh! Oh well. I guess it was too long anyhow! At any rate, I confirmed that the precise behavior is functionally equivalent to the two-variable version of the algorithm. There is one trivial difference in the behavior of these two algorithms -- your single-variable algorithm always starts the debounce delay timer one poll timer tick earlier than my two-variable algorithm does. However, using either timer tick is equally correct, because the actual button press event occurs at some unknown time between those two poll timer ticks, and it's equally likely to be close to either one. This algorithm saves the extra code and complexity associated with adding another variable to track the instantaneous button state. Ironically, the cost of that simplification is that the algorithm actually becomes harder to understand and reason about because of the logic inversion. Reading the code, the two-variable algorithm is more obviously correct. This single-variable algorithm is also correct, but that's harder to verify from the code. I asked ChatGPT o3-mini to write a summary. Here it is: "The algorithm leverages the fact that, because you poll the button at a fixed interval, the “last stable state” variable also implicitly holds the instantaneous state from the previous cycle. In each loop iteration, if the current reading matches the stable (previous) state, you reset the debounce timer. But when the reading first differs, you don’t reset the timer-so the timer starts counting from the previous tick. If that difference (the potential state change) persists for longer than the debounce delay, you then update the stable state and trigger the action. "In effect, even though you're not explicitly keeping a separate “last instantaneous reading,” you’re using the previous poll’s stable state as a reference. The algorithm detects an edge because the reading is different from what was stored earlier; then, by ensuring that difference lasts for the full debounce period, it correctly distinguishes a real button press or release from a transient bounce. This implicit edge detection works equivalently to tracking both the instantaneous and stable states-the only difference is whether the timer starts just before or just after the actual (but unknown) moment of transition, which is functionally insignificant given the polling resolution."
@DaedalusAI
@DaedalusAI 8 күн бұрын
thx for the detailed analysis!
@dtcorzine
@dtcorzine 8 күн бұрын
​@@sebastianrausch2261 I tried to reply to this earlier, but KZbin sent my comment to the bit bucket for reasons unknown. So I guess I'll keep this shorter this time. Your alternative is amazing. It's counterintuitive and feels wrong at first glance, but I painstakingly analyzed the behavior and confirmed that your single-character fix not only works correctly, it's also basically functionally identical to the results from adding a separate variable to track the instantaneous button state independently of the stable button state. It's harder to understand why the code works, but it does. Effectively, instead of explicitly tracking the instantaneous state, it happens implicitly instead. The only functional difference is that the debounce timer begins on the timer tick before the actual moment the button stage changed, instead of beginning on the next timer tick. Arguably, that's equally correct. Bravo!
@LifeOfErrick
@LifeOfErrick 9 күн бұрын
@24:14 ... wait, am I an AI?!
@GarageTinkering
@GarageTinkering 9 күн бұрын
According to my therapist, it's possible
@CoreyCoop
@CoreyCoop 5 күн бұрын
if you are using Arduino code, it would probably be a good idea in general to add "use any additional libraries as needed." You don't have to define them, let it figure it out.
@MarkPrince1317
@MarkPrince1317 11 күн бұрын
Thank you brother for shearing 👍 Best regards from Philippines 🇵🇭☕☕☕
@musicforlife4571
@musicforlife4571 9 күн бұрын
Deepseek has seriously impressed me, in addition, it is so easy to get setup to run 100% locally which is a massive extra bonus on top of something that's already impressive..
@SBCHardware
@SBCHardware 11 күн бұрын
Thanks for video. Subbed.
@paulcrabb7167
@paulcrabb7167 11 күн бұрын
Such a great video for us techy nerds ! - haven't managed to get registered on deepseek yet, will keep trying though.
@davidmeagor2560
@davidmeagor2560 10 күн бұрын
Took me several minutes before I realised who I was watching! Blast from the past there. Anyway nice video, good luck with the channel.
@GarageTinkering
@GarageTinkering 10 күн бұрын
Ha. Yeah, hey David. Hope you're well
@hicmikrolab
@hicmikrolab 8 күн бұрын
Nice video, Deepseek is very impressive. I have been trying my hands on for some time now.
@inastew1
@inastew1 11 күн бұрын
Thanks, very useful. As a novice coder I don't have the scope of experience to know the best approach or even where to start when writing from scratch. So I want to know which is the best AI tool. I would expect the AI tool to be aware of all the libraries and to choose the ones needed such as the key debounce library.
@GarageTinkering
@GarageTinkering 11 күн бұрын
Good question. It seems to me that it has a general broad concept of popular libraries, but I've not tried it with more obscure ones. Shouldn't be hard to feed it a link and let it figure things out
@helmut666kohl
@helmut666kohl 11 күн бұрын
It is aware of them, but also reads them at the same time and they are kinda simple - so it just output the code.
@mariesvilmy5680
@mariesvilmy5680 23 сағат бұрын
this feels like free course, thanks
@MrDmjay
@MrDmjay 10 күн бұрын
Wow thanks mate for sharing your insight. I came away feeling educated. Subscribed.
@yvesinformel221
@yvesinformel221 11 күн бұрын
I just register yesterday for DeepSeek and I asked it to generate code for 3 ESP32 that have one DTH22 each that have to send the date to another ESP32 using ESPnow and it generate the code. I though it would forgot about the 2 secondes delay between read (you have to wait 2 secondes between read), but no, the code seems to be fine. I don't have the hardware with me as I'm on vacation, so I cannot verify, but I am impress (in fact it's more than that 😲). note: I am just a thinkerer not a professionnal programmer.
@willrsan
@willrsan 10 күн бұрын
This is fascinating, mirrors my experience with getting deepseek to solve a problem none of the other AIs could solve. Deepseek came up with the overall working solution that had a simple problem which i could fix easily. THough I had only tested the free versions of the other AIs not the reasoning models so i dont know if they would have done better but I am not spending 200$ or even 20$ a month to find out. Also, reading the 'chain of thought' has given me insights into possible problems and improvements to my own code.
@onecalledchuck1664
@onecalledchuck1664 10 күн бұрын
I do like that the chain of reasoning for the solution is shown. All the other models I'm familiar with do not show the internal workings like this.
@kensaiix
@kensaiix 10 күн бұрын
it EMULATES reasoning
@alexhu7939
@alexhu7939 10 күн бұрын
@@kensaiixturn it off then!
@onecalledchuck1664
@onecalledchuck1664 9 күн бұрын
@@kensaiix - yes, obviously.
@kensaiix
@kensaiix 9 күн бұрын
@ huh?
@krozareq
@krozareq 11 күн бұрын
If doing a long and in-depth project, if you're able to integrate everything it's learned into a vector database, then that's where these things really shine. The chat's context window can hold increasingly more information, but it's nothing compared to a proper vector DB. The more it knows about your project, the better it is when you go back to it. Played around with some of the smaller R1 LLaMA and Qwen distilled models and was impressed for what it can sometimes do for being small agents (smolagents). Considering the smaller variants can run on such low-end hardware.
@pperrinuk
@pperrinuk 8 күн бұрын
A tip --- if the code doesn't work, instead of getting it to fix it (and add patch after patch), fix your initial prompt to head off the problem and start again from scratch... For serious development use GIT -- so when the AI completely screws everything up you can go back to a known 'reasonable' verision :)
@vichav3167
@vichav3167 4 күн бұрын
AI changed it's thoughts, when put button handlers in front trigger. It seems like it was thinking to put it in main loop from the beginning, but changed some parts of a code on the way.
@petercroft9895
@petercroft9895 7 күн бұрын
"That space" is going to change from knowing how to code, to knowing how to describe requirements to a sufficiently detailed degree that the AI du jour can deliver the required result. I'm struggling to get my head around what that description looks like for a large, complex project, but I guess it's still going to be more human readable than code, with the added benefit that the functionality is inherently documented to a high standard by that process.
@Traitorman.25th
@Traitorman.25th 11 күн бұрын
I asked it to teach me to use the program Blender to make a waving flag animation of a Swedish flag. I got a tutorial, which basically worked all right. Then I asked it to make the same, but with a Danish flag. I got the exact same tutorial, which gave me a Swedish flag again.
@GarageTinkering
@GarageTinkering 11 күн бұрын
As a long time Blender user myself, that's pretty funny
@Gatrehs
@Gatrehs 10 күн бұрын
As a Swede, this is pretty funny.
@Radiant_Cascade
@Radiant_Cascade 10 күн бұрын
Really enjoyed this video, new sub!
@OffGridOverLander
@OffGridOverLander 11 күн бұрын
DeepThink 🤣 I love that reference! I’m glad I found this video, I’ve been paused on my large electronics project only partially due to not knowing how to use EEPROM for an odometer. For context, I’m trying to move my military truck from the Stone Age up to as close to modern times as much as I can. Right now the Arduino part is on pause because I’m dealing repairing an oil leak, but I hope to return to that part as soon as the oil is dealt with. At least this new AI will help me get the code bulked out and running…hopefully, then I can fine tune it along. I would rather use a human who knows the code quite well, but military retirement doesn’t offer much for financial progression 😂
@GarageTinkering
@GarageTinkering 11 күн бұрын
Have to be careful with that. An EEPROM address has approximately 100k writes max before it stops working, so if you were saving say every tenth of a mile it would need a new address every 10k miles. Just something to watch out for
@OffGridOverLander
@OffGridOverLander 11 күн бұрын
@ I’m aware of the 100k write limitation, however I appreciate the info and it might help someone else who doesn’t know. I’m thinking of using an external EEPROM unit in the event I have any issues with the arduino and I have also thought of waiting until the vehicle is stopped to write a mileage, with perhaps a pre-shutdown code to write to the arduino’s memory as a fail-safe and a way to reload mileage when the external EEPROM is replaced. I liked the way you approached the troubleshooting the code, I’ve worked in aviation maintenance most of my military and civilian careers and that is how we addressed any issues.
@GarageTinkering
@GarageTinkering 11 күн бұрын
Yup, a pre-shutdown is probably how I'd do it too. Can't imagine I'll start my car another 100k times in it's lifetime.
@OffGridOverLander
@OffGridOverLander 11 күн бұрын
@ exactly! Even with a diesel that can go 500k miles, I doubt that it’ll require 100k engine starts to get there 😂 Even if it does, I’ll have other larger issues to worry about…like the starter and the engine itself 🤣
@thabangmoliane5026
@thabangmoliane5026 12 күн бұрын
Amazing. I'm really impressed with AI, and even more so, DeepSeek. Thank you for the incredible review, Val.
@GarageTinkering
@GarageTinkering 12 күн бұрын
It's all pretty amazing that we have this stuff at our fingertips for free
@ΧάρηςΚυπαρίσσης
@ΧάρηςΚυπαρίσσης 9 күн бұрын
To ensure fairness for the AI regarding the EEPROM function it created, it used the EEPROM update method. This method writes to the EEPROM only if the value at a given address has changed. As a result, it simplified EEPROM handling for the user and ensured that writing occurred only when necessary!
@brandongill8
@brandongill8 12 күн бұрын
It made me a working macro for Klipper pretty easily with only a couple fixes. The macro is for adding a nozzle cleaner to my CR10 V3.
@FinepixF30
@FinepixF30 10 күн бұрын
I think the AI got it right the first time, the problem was that it depends if you define the de-bounce for up flank or down flank, which depends if the push button has pull up or pull down resistor or the push button is normally closed or normally open, In this case the code where it says if(reading == LOW){ } for the toggle should have been if (reading == HIGH) since you want to detect the rise edge of the pulse. I would have changed that first. The AI reasoning mentions about the inputs pull up resisters so I would have also check what was the assumption there.
@GarageTinkering
@GarageTinkering 10 күн бұрын
It opted to use INPUT_PULLUP in the setup, so LOW is correct
@pperrinuk
@pperrinuk 8 күн бұрын
18:55 - when the prog runs it doesn't know if the eeprom stuff is what it wrote on a previous run, or they are values left over from some other previous prog.. so it fetches what may be random values and ensures they are in the valid range.
@ReinerSaddey
@ReinerSaddey 6 күн бұрын
So inspiring for a Java backend dev like me.
@ememeable
@ememeable 10 күн бұрын
Love It
@franklinslamo
@franklinslamo 10 күн бұрын
Nicely presented, thanks!
@robertkeyes258
@robertkeyes258 11 күн бұрын
It would be good to try the present versions of the other AIs, and Grok in addition, and see how they compare.
@GarageTinkering
@GarageTinkering 11 күн бұрын
It'll happen soon enough once I write a new test for them. Something with a bit more bite
@JesseOsby
@JesseOsby 10 күн бұрын
@@GarageTinkering WIll you also include a code editor with AI like Cursor in the test? It's my understanding it uses AI models tuned for coding tasks, so it might do better than these general chatbots
@gphuang67
@gphuang67 8 күн бұрын
Thank you!
@MikkoRantalainen
@MikkoRantalainen 11 күн бұрын
Great demo! I think this nicely also demonstrates that writing code is typically easier than debugging the code. The little AI was able to write nearly correct code but it wasn't able to fix it with a single bug report which was actually correctly written report (unlike real world bug reports by end users). I wouldn't have been happy with the code quality if I were code reviewing this but it's definitely smart.
@Todestelzer
@Todestelzer 11 күн бұрын
I developed an app to convert pdf to jpg with batch processing, wrong file input rejection, stay on top of other Programms with a checkbox, automatic processing if files dropped into it. It was entirely written by AI. But it wasn’t smooth sailing. Had to use different AI models to get it working. But without AI it would have been impossible for me to develop this app myself.
@C4reful
@C4reful 10 күн бұрын
I think it just differentiated between (a very short) button tap and (a longer) button press. I watched you do it and you were not pressing the buttons, you were tapping them :D
@GarageTinkering
@GarageTinkering 10 күн бұрын
Still a fail from a UX perspective if you have to split hairs about grammar to pass it
@eross21
@eross21 Күн бұрын
how much does deepseek cost to use? is it subscription based, or a token system, or completely free?
@GarageTinkering
@GarageTinkering Күн бұрын
Open source free
@eross21
@eross21 Күн бұрын
@ really? that’s cool. do you use it locally or through deepseek servers ?
@vex9596
@vex9596 11 күн бұрын
I never used something like this locally before, but figured I'd give it a try. Asked a fairly simple question on the topic of 4 digit, 7 segment displays. The answer I got was 27 (A4) pages long..quite literally. I don't even know what to say to that lol. The "thought" process sharing is cool, but that was way too extreme for me.. I dread to think what would happen if I asked a question that's actually complicated.
@cirion14876
@cirion14876 10 күн бұрын
The reasoning should be treated as internal processing, not as part of the answer to the question. I doubt the final answer was really that long.
@vex9596
@vex9596 10 күн бұрын
@@cirion14876 That's correct, "thinking" option in the software I used was enabled. Actual answer was approximately 1/4th of a page.
@MSIContent
@MSIContent 10 күн бұрын
Nice to see us coders still have a place! DeepSeek is very impressive, but it’s not “me” yet! i.e a 30 year coder! I use it for the simple stuff and ideas. I always finish the code.
@tatoute1
@tatoute1 11 күн бұрын
got the same idea. Very impressive but quite a tendency of overthinking, But the end result is quite good from start.
@eugene1640
@eugene1640 10 күн бұрын
Thank you for this video❤
@glennrmarks
@glennrmarks 9 күн бұрын
If the LED's are off and you press the button to change colours, should it?
@GarageTinkering
@GarageTinkering 8 күн бұрын
Yes. And it does by the end.
@glennrmarks
@glennrmarks 8 күн бұрын
@@GarageTinkering My natural instinct for design would be to only change color when the LEDs are on.
@l4zy64m3r
@l4zy64m3r 9 күн бұрын
I find the "Thinking" thing interesting. Much better than learning from a tutorial.
@CBleveldesigner
@CBleveldesigner 10 күн бұрын
how well does it work with C# ?
@kantpredict
@kantpredict 9 күн бұрын
I'm currently testing whether DeepSeek can rewrite the code that's ben bugging me for a few days because I don't know enough about logic loops to correctly order the various handshake steps I ned for this ESP-NOW communication stack. I know what I want to do and vaguely how, so I'm promtping DeepSeek at every turn to see if i can do better.
@zloyboy8
@zloyboy8 11 күн бұрын
Really amazing AI, the part I like the most in deepseek in comparison to others, is being able to toggle "deep think". Having it process the request into understandable language prior to outputting a final answer, seeing it debate how to deal with the request is truly fascinating. If you're not a professional at what you're trying to do, reading it's thinking processes gives a lot of insight into the topic. Certainly its not 100% perfect, but humans aren't either. I think it's likely that ChatGPT and others, will begin copying this thinking format from deepseek. the processes of forcing it to "over think" prior to committing to an answer, reduces chances of mistakes. The only problem with other models implementing this would be that they are extremely power hungry, and deep thinking is certainly computationally intensive.
@JoeTomasone
@JoeTomasone 7 күн бұрын
It would seem that not saving the state to EEPROM on every button press is a nod to debouncing rather than a mistaken thought; I.e. saving state only on VALID button presses.
@alflund6144
@alflund6144 10 күн бұрын
If this were a job interview quiz, I have to say that DeepSeek performed better than many programmers I’ve hired. However, the fundamental limitation of any current AI system is that its knowledge is static. Unlike a real person, it doesn’t truly understand what it did wrong and cannot learn from its mistakes in a meaningful way. Even worse, AI lacks the ability to find and update errors across its entire knowledge base. At best, it can correct a specific instance, but it will continue making the same mistake repeatedly-just in slightly different contexts. AI engines are still far from being able to reflect, adapt, and evolve their knowledge like humans do.
@ZhiweiLiu-sk1lv
@ZhiweiLiu-sk1lv 6 күн бұрын
there are some techniques to edit its parameters to update its knowledge
@andrewbergspage
@andrewbergspage 11 күн бұрын
Wouldn't just moving the LastToggleDebounce millis to after the check rather than before make the code work? Also "indigo and violet look very similar" is a result of our clinging to Newton's names for the colors while our definitions of the colors have changed. When newton named those colors, "blue" meant sky blue or cyan (00ffff) while "indigo" referred to what we would call blue or royal blue (0000ff). Notice that the hex values in the code have two levels of mixing red and green (orange and yellow) and two levels of mixing red and blue (indigo and violet), but no mixing of green and blue.
@sbaker
@sbaker 11 күн бұрын
So since you didn't specify in the original prompt if you wanted, or even allowed, it to use additional libraries other than what you specifically specified then there's a case to be made that the failed code was somewhat due to a slightly ambiguous original prompt. 🙂 This was very interesting, keep up the good work!
@RandomTorok
@RandomTorok 11 күн бұрын
Ok took a while to get access to Deepspeak. Asked it to give me a Windows Program written in C that says Hello World. First shot out I got a valid program... that ran in a command prompt and said Hello World. Then I went back to Deepspeak and said 'I was expecting a Windows program" 2 minutes later I had 8 lines of code that compiled and produced a little dialog box that said Hello World with an OK button. It even commented the code.
@PeterJamesMoments
@PeterJamesMoments 10 күн бұрын
Most of the AIs will perform well making a hello world program as its such a common everyday person test resulting will have a high weighting for the result. When a thinking model gets it wrong it leans from many users why it’s wrong reinforcing the correct answer for the next user. With a distilled model the AI learns the comman answer from the parent model making the model look clever but really it’s just spitting out a known comman answer. Ask it to make a hello world executable that prints to your printer and I think you will most likely find it will be less impressive. I guess it depends on what model you’re using.
@williamwatitwa3534
@williamwatitwa3534 10 күн бұрын
How about you ask it and give us the your feedback
@phizc
@phizc 10 күн бұрын
​​@@PeterJamesMomentsno model learns from other users, except that their interactions can be used by the owners of the models to train the next version. In that there is no difference between a destilled model or not. The new Titans architecture from Google aims to do that, but ChatGPT, Claude, Gemini, etc. don't do that yet. Tldr; there are no "learning" models yet.
@PeterJamesMoments
@PeterJamesMoments 4 күн бұрын
@@phizc genuine question if every users session with the AI is completely isolated then how does the AI evolve. Does this mean we are only interacting with the AI model in a formed state. With user interaction only filtering and molding the AIs output into a more relevant answer for that session. User interaction does not amend the AIs data weighting but instead works to create rules that fine tune the output. I think I need to look into how user interaction is digested and how importance is derived when response can have conflicting results or parallel answers.
@TheBookofBob-h2q
@TheBookofBob-h2q 8 күн бұрын
nice ..excellent work
@jpmorallo
@jpmorallo 6 күн бұрын
thanks for sharing
@xnetpc
@xnetpc 10 күн бұрын
I have a question. How long would you have taken to write comparable code yourself?
@GarageTinkering
@GarageTinkering 10 күн бұрын
With looking up all the RGB values I needed, probably same ballpark
@deathdrop3235
@deathdrop3235 10 күн бұрын
wondering how it would respond under the same test with an additional backtest request for the code it writes. as a person that has no coding exp. i would have asked it to backtest the code that it wrote for errors and resolve them before giving me giving me a final code to try.
@JRo250
@JRo250 10 күн бұрын
@7:00, for statement #4, I wouldn't call that a "misthink". Writing to EEPROM within a loop is indeed a bad idea. I'm actually impressed the AI thought of that on its own vs what you had asked it to do. IMHO, either save via a power down button/function, or detect Vcc state change as it's going down and only then save to EEPROM. All other uses of the state should remain in RAM.
@sKuNKdoSE
@sKuNKdoSE 10 күн бұрын
I had built a similar project for the lighting of my xbox360 using a pico. When it comes to the writing of its last used setting to the EEPROM, I don't think it's a "miss think" at all because it ultimately improves the lifetime of the storage. In real world usage, you would be adjusting until you're happy, I considered if there was no changes made within 30 seconds, then it would save instead of on each press of the button.
@vinodtavildar
@vinodtavildar 10 күн бұрын
Deep Seek🐳 thinking process is mind-blowing 👏🙏👍, I will try some Arduino nano code with it. Thanks for the video 🙏🙏
@randallyoung6715
@randallyoung6715 9 күн бұрын
Just a little knowledge plus a little time, and bang, working application. That's a game changer.
@robadub7141
@robadub7141 10 күн бұрын
I have noticed with other AI’s that explicitly telling it to find a simpler solution works most of the time when it starts over complicating things.
@glennrmarks
@glennrmarks 9 күн бұрын
I would not worry about using a delay() in such a simple program, and I would argue it is more appropriate here than a complicated debounce routine. If you had a real-time application that was stressing the CPU then a delay() would be bad practice.
@TerragonAI
@TerragonAI 10 күн бұрын
thats a cool test with hardware, thx 🙂
@albertcadgame8314
@albertcadgame8314 9 күн бұрын
WOW !!!! Impressive, the other day I watched a video showing DeepSeek R1 writing a Tetris game in Python language. Now it is writing another language - AMAZING !!!
@iNireus
@iNireus 10 күн бұрын
Do you think it’s better because its model is a lot smaller and trained from the daddy models? Though it seemed to over thinking but was that due to working like a 2 year in apprentice rather than a master with 20 years experience?
@MegaSuperJaBaTo
@MegaSuperJaBaTo 9 күн бұрын
Cool testing. But it would have been interesting to see whether a demand for an alternative library would have been sufficient, that the change or the debounce library would have occurred. There was already a considerable specialist knowledge here and so the test does not really reflect the knowledge of a beginner.
Arduino MASTERCLASS | Full Programming Workshop in 90 Minutes!
1:25:31
Programming Electronics Academy
Рет қаралды 2,8 МЛН
Which Chat AI Writes the Best Arduino Code?
1:00:47
Garage Tinkering
Рет қаралды 3,6 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
CompTIA Network+ Certification Video Course
3:46:51
PowerCert Animated Videos
Рет қаралды 9 МЛН
DeepSeek vs. Open AI - The State of AI w/ Emad Mostaque & Salim Ismail | EP #146
1:35:09
Quiet Night: Deep Sleep Music with Black Screen - Fall Asleep with Ambient Music
3:05:46
DeepSeek is a Game Changer for AI - Computerphile
19:58
Computerphile
Рет қаралды 1,3 МЛН
What if you just keep zooming in?
21:29
Veritasium
Рет қаралды 7 МЛН
What Is Reality?
2:32:23
History of the Universe
Рет қаралды 6 МЛН
Building a Supersonic Rocket Guidance System
33:26
BPS.space
Рет қаралды 427 М.
Deepseek R1 671b Running LOCAL AI LLM is a ChatGPT Killer!
19:13
Digital Spaceport
Рет қаралды 491 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН