#151 - ESP32 Passing Values 💾 Between Tasks - Deep Dive (2 Easy Ways)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and welcome back now this week we've got a lot to talk about in the terms of this little ESP 32 and what on earth is it doing here well alright it's passing variables from one to the other how do we do it two ways of doing it and I'll talk to you about both of them we've got a board here I want you to have a look at and last week when we did the prime number test it worked in 64 five milliseconds now it's running in 1768 milliseconds what is going on more about that towards the end of the video after all this I just wanted to mention my sponsor this week it's China's leading electronics components distributor LCSC electronics from their warehouses in Shenzhen China and with more Asian brands and lower prices they can pick and ship our orders in just four hours and all their components are sourced from authorized distributors or directly from their Asian suppliers at very competitive prices and if you have many components to buy you could import your bill of materials be OEM file directly into their web site try it now now if I said to you over here can you identify this in three seconds hold it the right way up for you yeah it's one of the many odd we know clans in fact I'll use this a little while ago one of my demos here that's nod we know clone okay and that's the standard Arduino shape though everybody's come to know and love and so what's this one then this is a bit different isn't it yes it's not do we know shaped board but with any SP 32 on it and as you can see if we can get the light to reflect correctly it's an e SP 32 W room 32 and no they still haven't told me what W room stands for and nor W Rover mm-hmm their little secret I guess anyway so if you fancy an Arduino shaped board this is it it's not that expensive says we must buy think lowly in the probably making it these days I'll put a link down there if you want to follow an affiliate link and it works just as you would expect it to except now bear in mind this is an ESP 32 not an Arduino so all these pins down here while some of them might be ok like the 5 volt in the 3 volt on ground an analogue these ones up here going to be very different are may so these the numbering system difficult to get the light on that but the numbering system on these pins over here is going to be very different now the SEL Sdn all that at the top is okay but all the other ones of course are going to be well ESP 32 specific so you can't slap a shield on top of this and expect it to work not unless it's one you've made and designed anyway anyway I'll put a link down below I thought you might be interested in seeing that they do do it in this format although I tend to prefer something a little bit smaller for production this is great for development but for production a small one like that or even your own sort of module is probably gonna be better just for the size really right what else are we going to talk to you about before we get onto passing of the variables there's a few things from last week's demo or last videos demo on the ESP 32 now we did the demo using core 0 and call 1 and they are totally and utterly independent cause now what you have to watch out though is that artists already uses cos 0 for things like Wi-Fi Bluetooth and stuff like that and especially if say caution when you use core 0 because if you put something on there that is power-hungry CPU cycle hungry it's gonna starve those other tasks of CPUs and your ESP 32 it's gonna crash it's as simple as that what will happen is you'll get a panic message in the serial monitor if you've got it wired up and you're saying panic watchdog the let's into action and then I've restarted it and trouble is you'll get to a recycled boot at that point so yeah you don't want that to happen so if you're developing stuff I would say keep all your tasks on core 1 which is what we're gonna do for this demo now whilst everything we do in demo land here would work on core 0 and/or core 1 I'm still gonna push things over to call one a little bit more just to make sure that everybody out there understands that core 1 is what we should be using and the good news is of course that whether we use core 0 or core 1 if your tasks are running on a core they do not block other tasks you've got train system rar tosses is there sorting out what's going on under the hood as it were and if you've got a task running on core one that says flash and LED delay for a second flashing LED and you've got another task running on coal one that says similarly flashing LED delay for a second none of those delays interfere with one another that's because the delay no longer is a simple count up loop it isn't just count up a loop like it doesn't an Arduino the delay tells the operating system it says excuse me operating system I'd like to suspend this task for 500 milliseconds and the operating system says yeah that's fine I'll just Park you all right so you're parked for 500 milliseconds and nothing happens you do not consume CPU you do not interfere with other tasks running and when your time is up he goes take you out that suspend queue now and put you into the ready queue to be given some CPU cycles again when you're scheduling bit comes around okay that was the first thing right the demo today is all about passing variables from one task to another this demonstrates it but you won't understand it from that until I've gone through what we're using and it's all about queues as the title of the video perhaps has given away queues are very easy to implement they're not difficult and whilst there are alternative to queues and the the espresso and artist manuals are saying you know you can do this you know that may be but queues are a really good way of passing variables across safe secure let's go and have a look at what keys are all about so how are these two tasks here going to communicate together now if you don't know about this sort of theory stuff then you can skip forward to the time shown on the video now and I'll catch up with you when I've gone through the explanation or perhaps what do you know this stuff anyway so you can skip forward if you want otherwise stay tuned to keep watching Tom zero will call that a manager task because it's the one that determines the work it wants to do by the little worker task here and yes that is a little worker bee I hadn't got a yellow pen that's why he's blue all right so how that he's going to communicate in a safe manner well what they need in the middle is a cue what's a cue it's just an area of memory that you've defined and you've said how many elements can fit that cue to make this a little bit quicker demo we're gonna have a cue that allows two values task zero the manager can put values into this cue and task one the worker can read values off the cue so to start with if these tasks were to start at the same time task one be wanting to read something off here but finding nothing so it waits forever because you've told it that but task zero the manager says are there space I can put some work on here now what this is going to do for the demo purposes is just to put a number in there and then task one the little worker bee here will flush that really red LED that number of times so it's always first in first out you can in fact change where the value goes into the cue but let's keep this simple so manager says I've got some work to do I want to put a value out there and I'm gonna put the value two in the first available slot in my queue and then it goes away and does some other stuff that may take some time in the meantime task one that's been waiting for stuff to appear here's his RUP I can read that number off my number two and as if by magic that number disappears from the queue and then task one worker flushes their LED twice and then tries to get another value Oh in this instance there isn't anything now however the manager gets its act together and says right I've got some more work for you task one here's a nine they all like to keep you busy for a while well and even before you've snatched it away I've got a seven to go behind it when I've got I've got another number but I can't put it in the queue because the queue is now full so I'm prepared to wait forever until a slot becomes available that queue so I put my next number in it so task 1 the busy worker B jumps into action says great I'll have the nine please and as if by magic the nine disappears and the seven shuffles up a level now the worker flashes the LED nine times which takes a little time in our demo it's about half a second to flash so it busily goes along staying that whilst it's doing it in parallel tosh.0 the manager says ah you've only given me more space to another number here's a number to go in there number one well eventually cause the worker finishes with a nine and says give me more work please are good there's a seven now this carries on for a little while seven gets taken and gets removed off the queue one shuffles up and there's space now for more work if there isn't he if the manager is a bit slow at this point I know perhaps it's gone away to read a sense of value or water level in the tank or bees in the Beehive why not it could take a little while before it does that and indeed some tasks might be very slow running it might only put a value there you know once a minutes or something so anyway if this worker task here has now flashed the LED seven times it goes give me more work and the one is taken and disappears from the queue again now flashing one LED once is is pretty quick so it does it says give me more work oh there isn't any okay well I'll just sit here and wait and while it's waiting it does not consume any cpu cycles so it is quite efficient to do it that way have tasks sitting around now we've said to both these tasks in this little demo I'm prepared to wait forever the task one worker tasks is prepared to wait forever until something arrives and tasks zero the manager is prepared to wait forever until a position becomes available in this queue because we've told you that we've said in our demo sketch wait forever but we could have said wait far far less time that we could say wait 10 milliseconds wait 10 seconds wait 10 minutes but whatever when that time expires the attempt to place a value on the queue here or to read off a value will finish and the value returned from that attempts will contain the value that your code can interrogate and say oh I didn't manage to get a value on this queue in time and I need stack summation and similarly the work tasks and say I waited for the dime you told me to get a value and there wasn't one so now you need to take the correct action in your code to deal with that logic now we discussed it's more in the main video but remember this task zero and task one can all be running on the same core and if that's the recommended way to do it remember that your your ESP 32 has to cause so you got cause 0 and caught one not to be confused with tasker numbering 0 tends to be used by artists for running things like Wi-Fi and Bluetooth and stuff like that now whilst you can put extra tasks in here if you start starving the Wi-Fi or Bluetooth tasks from CPU cycles your ESP p32 will panic and crash so the general advice from espresso is use core one for your tasks and very carefully think about whether you need to use core 0 or not so these can be on the same core they can both run on core 1 simultaneously as we'll show in the demo so is there an easier way of allowing these two tasks communicate without the use of a queue there is but you still have to be careful at the end of the day it might be more work than actually creating queue the first thing you can use of course is something called a global variable we've all used them and well they're no different in this context and than any other context with your Arduino let's assume we've got an integer integer what we're going to call it temperature and equals what we don't know because the manager hasn't yet put something in there but it's a global variable declared at the top of your sketch before the set up and all that what the manager can write to that value and the two work tasks here can read that value and more than likely nothing will go wrong with that so they can do this without any other involvement except the expressive sight mm-hmm we don't guarantee that it'll probably work but it's not the way to do things if you're going to do this global variable sharing then you really need to also introduce once again semaphores and this time we need something called a mutex semaphore mutually exclusive semaphore it's quite simple but both tasks are going to have to do it so that when task one worker is reading from that variable it sets a similar water says I'm taking the semaphore and you cannot update it task 0 once it's read it it will remove that and say ok you can update it when you want because I'm not in the process of actually reading it this microsecond but when the test asks zero here wants to update it it says well I'm about to update this you work a task cannot read it because you might be reading it in the middle of me updating in goodness knows what's gonna happen men so we need to set up a semaphore at both ends to protect this value via this mutex simple to do but whether it's any simpler than currently queue well that's for you to decide right now you've got an idea of what queues are happening you understand exactly what's going on with these little flash LEDs so the manager the the instigator of the work is the blue LED and the red one is the one that's flashing the LED in number of times so I'll put the debug window on this as well so we can follow it through that what's happening but if you even now you can see that the blue LED is not flashing that often because the red one isn't getting through the work enough occasionally you might see a double flash now that was quite a quick flash even a triple sometimes but obviously the manager here is having difficulty putting stuff on that cue because red isn't clearing it quickly enough let's put the serum on strands I just said and see what's really going on right so then worker the red one is the one on the left here saying I'm reading whatever value you've put in the queue and the manager is saying I'm adding these numbers of the queue now remember in that diagram that I showed you the manager is trying to put them on as quickly as it can but we've added an artificial delay in there to making sure it's not you know stupidly quick and generally look it's one for one but occasionally as in here and we'll just stop it right there occasionally you see that a worker managed to get through a little bit more work because the work is trying to do flashing an LED once is quick so it quickly snatched another one off the queue which is a for now that one and for came from probably up here so one and four because the cue I've got is a five position cue we can put five integers on there so it snatched off one and four but then because it took two off the manager said oh I've got two positions to fill now and I'll quickly add them as well so that's what's happening and if you look at the fleshies down here in the actual diagram here you can see that the manager is quite slow in putting work on the queue and the red ones just going on and on and on and on okay occasionally as I say you might find too sometimes sometimes even three flashes from the manager put in some work on that cue but what we can do is emulate what happens if it the if the manager wants to have a tea break for example because that I've had enough I don't wanna do any more work so if I press this switch it basically tells the manager to go never tea break and not put work on the cue anymore when that happens you'll see that the red one runs out of work pretty quick you can see behind my head that managers having a tea break the work is reading the cue there's only five elements and no it's not now it's done all those if you look on the right-hand side working up it says going backwards it says adding 8 to the key reading 1 adding 3 adding 6 and that's exactly what on the left hands are down the bottom is it's done so the cue at the moment is empty so when I let go of this little switch the manager will find that there's plenty of space in there and it will fill it as quickly as the code allows it to fill it and the work are all quickly snatched work off thank you so I'm gonna let my finger off oh I'm in the way again now you see there look the managers managed to add two three oh and again three so it's added three up here to the cue and here and another two because the cue was being read reasonably quickly but multi-point it was empty to begin with its added 1 and if 100 now is I can add 3 and one go so that's exactly how it work now can you guess not guess work out if the managers trying to put work on that cue but the queue is full because the worker is not getting to real work enough what could you do to alleviate that exactly add another worker task so where we have at the moment one little busy bee trying to flash the LED what happens if we had to well obviously get to twice as much work wasn't it so you can add extra tasks but with that comes a certain level of complexity if you're trying to write through to the LED to make it flash but the other task is also writing to it or turning it off there's a bit of a struggle there isn't there and once again you should really not share resources like that unless you can put a semaphore a mutex semaphore in the way so it starts getting a little bit trickier but then again we are you know we're using a more complicated chip only this is not an Arduino this is a dual-core multitasking system with a real-time operating system managing you all so yes it is a little bit more complex let's have a look at the code what I've done here then right so the code then pretty much like you saw in the previous video we're going to use a couple of tasks at the top so I've called them still tasks as area and task one I suspect if I write this for a real project I'd name them a lot more descriptively than that so I might know I might name one task get water level and another one task display water level for example because task 0 task 1 means nothing apart from the fact last demo we were running them on cos 0 cool one but well even as is for now I think it's okay now what we're introducing here there was a queue so there's a queue handle type and we're calling it rather rather unimaginative leak you once again I'd probably call that something a bit more meaningful as well we've still got our two LEDs on 27 and 25 my switch there on pin 2 simply allows me to tell one of those tasks stop stop work have a tea break that's all okay it's just for demo purposes right so loop 1 loop zero those much the same as what we had previously it's a do forever loop we're generating a random number now to go onto that worker cue list that's all but that's not important what is more important is that we're sending stuff out on a queue like this let's just whizz through those parameters very easily so the queue we've defined at the top all right so we're saying queue send this to the queue and using this particular function at lowest fill it from the back so the first one in is the first one out but when you send it it'll always go in behind any others the random number let's remember winter to the random numbers he need the ampersand and we're saying here wait forever if that cue is not available I suppose available is probably the wrong word if there's no space on that cue wait until Aries forever then it flashes the blue LED just once just to show that it's done some work checks to see whether it should be taking a tea break or not want me pressing that button and that's it I mean there's no more to it so it's doing all that work you know pushing it onto the cue and forgetting about it there's no there's no tie up between what the task is doing the cue and what happens that cue is it says all you've told me to do is put stuff on a cue I don't know what's having it or after that I don't know if it's being read not being read being corrupted don't know don't care it's single responsibility time here keep your tasks nice and small and doing one thing much much easier to debug as well especially in the multitasking system now okay this is the manager then that was the manager code let's have a look at what the actual work is doing so the work is saying right I'm receiving from the cue remember first in first out queue namers as previously there's my variable that I declared here so that's a reference to that variable and once again I'm saying wait forever if there's no work on that key if you can't read something from that cute just wait until there is something and at that point remember no CPU cycles are being consumed okay now assuming it does manage to read something it says it prints out here what it's actually reading so this this bit here for example is where this bit comes out and this is a quick aside if you're using string with a capital S like that in Arduino world or esp8266 don't blame me if your program eventually crashes because it does fragment the heap memory and it's string just wasn't well wasn't written particularly well I guess I don't know but here I think the string is is a different implementation altogether so anyway I'm using it as part of the serial print converting that integer to a string so we can put it all out in one line and then I'm saying now flash that led however many times you need to flash it according to the number on the queue I did originally put a slow-motion delay in here but basically it made it so slow that even I got bored okay right so that's that's the to work tasks then well manager tasks and worker tasks set up I think is probably pretty much and this is where we create the queue it's five slots and the size of an integer which is two bytes piece that's ten bytes that's it two tasks they own they're both pinned here look two tasks to call one yeah on both of them so we're not using cause zero and upsetting Wi-Fi and all the rest of it and eventually we come to the original loop so when you start a new sketch you get your setup and your loop what exactly we're going to be using this loop for hmm in this particular demo we haven't really got a use for it but as we saw last time you don't put something in there like a delay delay one yield will not work because yield translates to something else and it's not enough you need to actually put a delay in there the delay of course is not we know expression is it's not C++ delays Arduino friendly speak what delay translates to in this implementation is a V task delay and the number of milliseconds in the in brackets so if you typed in V task delay 100 it would delay for a hundred milliseconds if you type in delay 100 the compiler just changes your delay to a V task delay and composer exactly the same so if you want to stay with Arduino friendly language you can there's no there's no downside on the other hand though if you thought hmm I want to move away from that Arduino land speak a little bit a more into our toast world you know ESP 32 C++ speak then by all means use the V task delay and there's lots of things like that but back to our loop what are we what are we actually going to do with this loop it seems seems a shame doesn't it in some ways that we have to put a delay in there so that the the program that surrounds all this that says run setup run loop forever in that same four construct that you saw and all the loop does is say put me on the queue to delay me please for one millisecond one millisecond later comes off the queue gets ready to the consume cycle just doesn't need any ends the task comes back in put me on the queue please for suspension for what it's it's madness to do it that way so what can we do in that loop or what I've done it seems to work quite well it's to say look delete me the first time you come in here the delete this task that's running that was scheduled by someone else not me though and remove me entirely so I don't I don't get called again and that works wonderfully well now whilst that is an option I've also used the loop more as a a coordinator of tasks if you're writing lots of tasks you know when it's loop 1 loop 0 names properly of course and I've found that in some of my demo sketches I'm just written for me now I've used loop to do things with these other tasks so focus on block and say you know what suspend loop 0 please because I'm not ready for that one and let one run for a bit and then when certain conditions about say ah unsuspended loop 0 now and see what it says and it goes and runs so you can doall see all sorts of things like that you don't have to delete the task however if you wanted to run a task side like loop zero but you only wanted this run for a little while until certain conditions are met and then that's it you've done your business I don't want to hear from you ever again all you need to do in this loop is have an if statement say if certain conditions are met deletes me please so V tasks delete with a null as a parameter instead of a task handle deletes the current running toss so the alternative then two queues okay yes global variables as you saw in the the drawing global variables yeah they saw work well sort of what they do work but as it was that contention issue and you need to add in semaphore so what we've got here is a semaphore to LEDs what else yeah so what we've got here then is an unsigned long where we're going to add something to account so there's two tasks 0 & 1 both writing to the same variable to say update update update and the count just goes up and we display that value okay so the tasks themselves so this is tasks well loop zero I've caught it but it's tasks zero basically it grabs the semaphore updates per count in in that print and then releases it oh you have the plus plus in front of the variable rather than behind it means update this variable first then carry on if you put it behind the count so count zero plus plus it means do whatever you're doing and then add one okay so yeah I suppose I should have made to know about that anyway so all that's doing then is updating this count with the semaphore in front of it and behind it and it comes in you know microseconds flushes the LED and here we've got a delay oh you can see this is where I've described the delay for 300 milliseconds the same as V tasks you can choose whichever one you want and note it is the task that is blocked not the entire thread well the task isn't exactly blocked it's it's put on to suspend queue I guess you call it it's described in more technical terms and there's specific documentation okay so when you say delay me it takes it out of the ready queue puts it into a suspend queue and then back again when it's ready ready means I'm ready to receive some CPU cycles to actually do some work remember the code sitting there memory but nothing's happening is not being executed because the scheduler is keeping control and time slicing is required all the different tasks on a particular core and it does that for both cause independently so being ready to run doesn't mean you will run and especially if there's a higher priority task waiting to run that will get serviced first but when we set up our tasks I think you remember we set them all up is either priorities 0 or 1 don't want to go there yet that's for another time so loop 0 does that and guess what loop 1 does yep exactly the same no difference at all okay so in the setup we set up both tasks right here's my semaphore that we've created it as a mutually exclusive semaphore I'm creating into two tasks exactly as we did before nothing different about it really both running on core 1 and core 1 and that's it and then on the loop would it be doing the loop now that was me experimenting a suspending task we're basically in this implementation we're doing it delete okay let's see if this works then let me upload and we'll come right back okay so here we are that's all uploaded and I've moved me out the way of it so you can see behind my head and so we'll just running so the LEDs down here are flashing away just to che say yeah I've done what you asked me to do so the red ones flashing quite quickly really compared to the blue one which is why in loop one you're seeing lots of additions to that counter setting up one to the counter a lot quicker than the loop zero is which you can't even see from fleeber there is let me just stop that now so it's running quite happily and as you can see they're not being corrupted the integer that it's adding this counter that it was along wasn't it he's protected by that mutex that mutually-exclusive semaphore so only one task can update it at a time now you might think do you know what I can't be bothered with all that I'm just gonna write it to the to the global variable in the first place and and hope for the best well hope for the best but eventually it will go wrong now going wrong might not mean bad things yeah I mean if you're counting bees in the Beehive and you miss a count or add two to account does it really matter no but it's not good programming practice and you're making shortcuts and it's it's not a good way to do things so adding in a semaphore like this here's a good way to do it but is any better the queue where you tell me writing to queue and reading off the queue without any semaphores or having a global variable with a semaphore either side to say yes you can write yes you can read and so on is that any better pays your money takes your choice right one final thing then before we close down this sketch this some unsigned long here that we're writing to buy both sketches you'd notice that I put a volatile on it and the static now I'm not convinced I read about this I'm not convinced the static is necessary but the volatile could well be in fact is the suppressive say it is because think about what's happening the compiler has compiled all the code and it knows which variable it's writing to from task 1 and it knows about task 0 but it doesn't know the two are writing to the same is in the compilers not that clever so if it writes one to a variable and it has that variable value in a register rather than the memory location because it's already ready one thing keeping it in a register the compiler optimizes that and goes well I don't need to read it from the memory anymore cuz I've got it in the register now and nothing else is in that register I'll use the register value instead so if you're reading that value from the register in the same task that's absolutely fine but what if another task was come along and it's updated the memory value as we are doing here most certainly we're updating the memory well the compiler is still reading out the register it's not reading the real value up here you're giving it corruption which is why you need volatile what volatile tells the compiler is do not read the value in a register even if you think you've got it in there ignore that go back and read it from the memory simple as that that's what pilato does ok that's it right I think yeah we were talking about speed won't be in that big slowdown for the prime numbers well that's all it brings an in really to that bit of the video if you're not worried about the next bit coming up about the speed difference and all that you can buy all now but please do leave some comments down below and if you think it's worth it stick a like on it tell your friends family neighbors everything about the channel I mean ok but really nice to have you with us see you next week ok we've come to that bit we're gonna find out why this is now running so slight was 68 milliseconds last time running all those prime numbers anyway the point is it's now running at one point seven ish seconds let's have a look at the code shall we and see what it's doing right so the code is as you can see as we saw last time so let's connect up a serial monitor view on there and it says running loop here we go 1750 one milliseconds that's that's that's it was running in 68 milliseconds all right now it's running in 1751 that is a huge slowdown so what's happened yeah I know you think I'm gonna be you know it's not clickbait believe me it's not clickbait this is a serious thing that you probably want to do at some point if we look in the code scroll down a bit yeah that's all the Gavin's blardy blardy blar oh well there is a bit of change where's it gone oh I know in setup and just before I click open this setup here I've had to recall this in there is how fast by default is the ESP 32 running to give you an idea the Arduino Uno runs at 16 megahertz alright the chip itself could run at 20 bit because the crystal and have divided and like they've chosen 16 so that's what all arduino uno x' and nanos run at 16 megahertz I think the mega might also run I'm not sure anyway so how fast is this running at 240 megahertz exactly I mean that is pretty fast isn't it 240 dual-core I mean this is getting into you know the computers of yesteryear isn't it ok carry on right so what have we done in setup that's so different right look at this so set CPU frequency yeah and I'm running well 10 megahertz 10 okay so 240 megahertz is the default which is so much faster isn't it than the Arduino but now we're actually running slower than the Arduino 10 megahertz versus the Arduino is 16 so how come it's still running faster than the Arduino well I guess that's the architectures and it's got to cause I suppose it's using both cause all the Tasha jewelry's maybe possibly who knows what it's doing me on the scenes SRT OS is near where artists so we can set any speed we like here - well not any speed with lights what be one of these two 41 60 so it's a multiple of you know whatever this is a multiple of there's any Sun some you try put in something else in there I did try to get it down to one megahertz and immediately an error came up at runtime so oh you can't do that I'm just leaving that alone so just to prove then that it was this speed thing let's change that back to the full 240 right and compile that and upload it and Loras the gubbins I'll speed this bit out no way right off its going to build it does take quite some time to build sometimes depending on what you've done before right time to speed up the video okay it's actually uploading and I'll keep you your eyes on the speak behind my head there a look back to 61 milliseconds was his sixth wealth or was 68 61 62 whatever is a huge difference isn't it just by changing that speed now you might say alright why wasn't this clique debate then you said it's running slower now it's running full-speed again well the point is of course the faster it runs the more power it's going to consume if you're just waking this up every now and again to do something do you really want to running it 240 megahertz I can remember when Pentiums ran at 200 megahertz and that was like wow really big thing you know so we're running a microcontroller here dual-core microcontroller not just one of those single ones at 240 minutes do you really need it to go that fast if you're just reading a rain sensor or something some-some something that you're possibly running on battery power that's the whole point isn't it you could wake this up and run it at 10 megahertz and it would use far far less power and I'm not going to measure it but it does use this palace what expressive say and it could still do the work maybe a little bit slower as we've seen but well you have to make your own minds up I'm just giving you the option here to change the speed to whatever you want okay so that's why it was running slower 1.75 seconds compared to 68 62 milliseconds what a difference that speed makes use it as you will you can't as far as I know change each individual core is just that the whole thing rather the CPU as a whole so that's the way it is alright that's it just thought it might be useful for you to know that and that just about brings it into the the entire video now thanks very much for keeping up to the very end I do love your comments don't forget to put them down below if you think it's worth it stick thumbs up on it and keep watching see you in the next video I hope you're finding these videos useful and interesting there are plenty more videos to choose and a couple of shown below and if you'd like to subscribe to this channel just click on my picture below and enjoy the rest of the videos thanks for watching
Info
Channel: Ralph S Bacon
Views: 48,151
Rating: undefined out of 5
Keywords: ESP32, Passing Variables, Passing Values, Deep Dive, Global Variables, Queues, Queue, pass variables, lcsc electronics, Arduino ESP32, Beginners, Arduino, Wemos Mini 32, C++, electronics, programming, microcontrollers, Wemos D1 Mini 32, Dual Core, Multiple Tasks, esp32 tutorial, Semaphore, esp32 arduino, arduino benchmark, ESP32 vs Arduino, Speed Test, ESP32 vs UNO, esp32 review, esp32 project, esp32 arduino ide
Id: ywbq1qR-fY0
Channel Id: undefined
Length: 38min 38sec (2318 seconds)
Published: Fri Jun 28 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.