well welcome back to the series of videos on the unit 6 microcontroller exam for btec level 3 extended diploma and engineering today we're going to be looking at the program plan for our little brief that we've written on the taxi calculator i'm going to take you through how it's going to be answered and then we'll also look at an example of how to build it in a program such as powerpoint so like the last couple of activities or like last couple of tasks it's part of activity 3. and this is how activity three is set out we've looked at the first two bullet points on here and now we're gonna be looking at the last bullet point and you need to create a plan for the program structure detail and key system operations so we've looked at what the device is going to look like from the hardware and how all that stuff's going to connect up now we've got that in mind we need to build a program around that it's not the program i'm not going to that a little bit now but it's a plan that we need to do before that so a quick overview of the section like i've just said it's a plan for activity 4 which is a programming element of the exam note that there's been quite a bit of the exam covered so far and we've not actually gotten any of the programming yet it's a plan for how you'll set out your program and it's really important to do this before you actually do any programming for a larger program because otherwise you could get into some loops or get yourself all tangled up when you're building a program and it won't quite work the way you wanted to another thing to stress is it's definitely not right in your program you don't put your actual program in here it's a plan so it's a lot simple learning program will be and it's going to give an overview of how you expect it to go and it's going to help you answer activity 4 when you're doing that programming looking at how to write this you're going to probably do it as a flow chart there's some other options available like pseudo code and if you've learned how to do it that way that's fine no problem with that but i think the easiest way to access it and the simplest way to do this is through some kind of flowchart it doesn't have to be a flowchart looking exactly like the flowchart software that you might be using such as flowcode or something like that but it should be a flowchart type of structure that we'll go over in a second exactly how it looks you'll want to keep it basic and simple and you want to not go into any huge deal because that's what your program is going to do however i would still say you want around 15 to 20 blocks in your uh in your plan so your flowchart plan should have around 15 and 20 blocks in it and that will give plenty to ill for the plan of your program and how the structure is going to be in your program and often you'll probably want to put a little bit of accompanying description in there so a paragraph or two just going over some details that might not be obvious from the plan and this is kind of used to really highlight some points of your program to the examiner to make sure that they know that you've included everything that you need to include so now we're going to have a quick look at how to build this i'm going to be using powerpoint i actually prefer to use publisher but many people don't like publisher and don't use publisher regularly but if you can use publisher then i'd probably recommend to use that because it's a little bit better and a little bit more powerful however powerpoint does work fine and most people have access to that in some way as i said i'm going to be using powerpoint to build the program plan first of all you'll probably get say something like this set out like a slide we don't really want a slide so we're going to design and i'm going to change it to go to custom slide size so if we go in a slide size and then a custom slide size then we can choose a different size of paper and because the workbook you're going to be working with is going to be a4 go for a4 and we'll say i want a portrait screen it doesn't really matter about this section it's just maximizing what we've got here but actually i want to delete both of these points here so the next thing i want to do after delete these there we go is i'm going to zoom in now different ways to zoom in you can use this little zoom bar on the bottom or you can hold ctrl and scroll and that allows you to zoom quite easily and if you've got insert at the top here then we've got shapes and we've got some handy dandy flowchart tools here so i'm going to go for one of these ones with a rounded edge so these usually represent uh start and ends it's called terminators and phil charts it's not the end of the world if you don't use exactly these shapes but it's probably quite good to use them and because we're going to use make quite a big flow chart and it's probably going to take up quite a bit of this page i'm going to shrink it down a little bit a little tip for powerpoint and things like that if you hold ctrl and you resize something at the corner it resizes uh in all sides at the same time if you hold ctrl and shift it keeps it to scale so there's a few tips for powerpoint and publisher in with this as well a little bit of a bonus for you if i double click i'm going to add some text in i'm going to say this is start and i want to shrink that text a little bit so i'll show you down then i want to insert a rectangular block so the rectangular blocks are just for instructions things that are going to happen and right at the start of this what's going to happen is the user is going to in the initiator journey now that text you can see here it's way too big i've still got a capsule as well so i'm going to start at 12 because most of the document you're going to be writing is going to be in font size of 10 and 12 so we're quite happy with 12. and the first thing is going to happen is oh didn't actually resize and saw that in a second the usual user will initiate a journey we'll shrink that down the size there so it fits in quite nicely so when we zoom out you can see it's going to fit on a page quite nicely it's still going to be very readable uh even better when i spell things correctly we will be putting some arrows in a moment but uh before we do that we'll add a few blocks and i'll add a few arrows together again if you look at the specification uh the device starts with a one pound fifty fare so i'm gonna start with device adds one pound fifty to total so it's going to add 1.50 to the total fare then we're going to say that device starts at starts to count to 20. it's one a little bit big this time i can expand this a little bit and so it fits in quite nicely so it's not going to take up too much space i've got start uh the unit you use that initiator j so either i might press a button to initiate the journey or something like that and then when the journey starts the device is going to add 1.50 to the total and then it's going to start counting to 20 for uh 20 seconds and because every 20 seconds is going to add some thing to the fair if we go back to shapes we've got some quite useful connectors here i'm going to go for the one here with a single arrow and what these can do is when you put your cursor over a block you can see it gets these uh points and they it automatically puts an arrow between the points you usually want to go vertical it does have a little elbow it's a little bit annoying that that happens but it's not the end of the world if i click that and press ctrl c then ctrl v it copies and pastes and i can put another arrow in and i press ctrl v again and paste again and i can pop this these three arrows together so i'll probably go through doing a few blocks and then go through doing a few arrows and just keep things in line it works a little bit faster that way and i will be going through this flowchart quite quickly and i won't expect you to do this remember you've got a planned time of two and a half hours for the hall of activity three and i'd say maybe an hour for the hardware selection half an hour for the hardware connections and then another hour for this and you can trim any time off that would be really good because you can use that more for programming but i think uh you know people underestimate how long the two and a half hours is for this whole section so after the device starts to count at 20 it's going to be counting to 20 but while it's doing that you're going to be wanting to check to see if the user is going to be pausing the counter or if you're going to be adding a discount to the fare or something like that so what we're going to do is we're going to put in a decision and a decision is a diamond shape i have a flowchart icon for that it's got a diamond shape and the diamond shapes have to be quite big because i want to start moving things into the diamond shape it's quite difficult to put some text in there and all i'm going to say is here button pressed and i'm going to shrink that back down at 12 points of font size so you're checking to see if somebody's pressed a button and the different buttons that can be pressed now are to pause the button to stop the timer when you reach the end of the journey or no buttons pressed at all i've got a few different options here if we do pause it's really easy all we need to do is add another block hold ctrl i'll drag it across here and this just says pause counter pause counter pause timer and what we would do is i want some more of these arrows so this one's going to go here this one's going to go here you see it does get a little bit repetitive but it's pretty easy to do when i put the last one in so it's going to start coming out from here and it's going to end going into the bottom of the same place it's going to go so this is a little loop so it waits to see if you press the button if you press the pause button it's going to go to pause counter and it's going to come back around and it's going to check to save press a button and come back around again if you grab this little orange dot here i can try and line these up a little bit so these arrows line nice nicely so this goes and joins this part here the other button i could press is a stop button and another option which happens is that no buttons pressed at all so if no buttons press at all it's going to keep on counting so if no buttons press at all i'm going to want to see if we've reached 20 seconds so it's going to check we don't actually want a block here we'll probably want a decision so it's going to be 20 seconds past and to clear things up as well what i can do is add in some text and say this is a pause button again shrinking that down don't need anything like that big of text i might even just clarify what it is it was pause button i don't really like that at the top so down here and even trick it down a little bit more there we go that seems a bit better so you press the pause button it's going to go follow there if we don't press a button so is button pressed no it's going to go this way copy an arrow let's go under there it's going here so if you don't press a button it's going here has 20 seconds passed if it has we need to add something to the fare now i want to move this to the side a little bit because i've got a little space on the left i don't think we're going to need any space on the right particularly let me even be able to shrink this down a little bit there we go so if we have had 20 seconds passed we need to add 25p to the fair and it's going to go back round checking if the button's pressed or not so there's quite a few things going on here i am going through quite quickly feel free to stop and rewind if you're not exactly sure what's going on but because it's quite a long process i'm going to start speeding up just a little bit now what i've done here is i've made the arrows uh try and line up here so it's quite quite clear what's going on and then i want to add another arrow in which is also going here this is going from here drop it down as well you can see i've made everything line up nicely and this last arrow is going this point so it has 20 seconds past if 20 seconds hasn't passed it's going to loop back round if 20 seconds has passed it's going to add to the fair there we go the last option we need is if the stop button is pressed and this signals the end of the journey so we're going to have something else going on here so if you press the stop button i'm going to have instruction here to say stop the timer and then we've got the option add the surcharges or the discounts so ask for surcharge or discount it's another bigger block here i'm going to expand that vertically a little bit it doesn't matter that all the blocks are aren't the same size it's nice to have a lot of them the same size but if one needs to be a little bit bigger that's fine as well i'm going to add another button pressed so i'll press ctrl and drag that down if i press ctrl and shift by the way if you hold shift it keeps it in line in one of the ways if you hold control it uh hold ctrl add anywhere hold ctrl and shift will do the same so that will copy and paste so it's going to see if we're preparing to press another button about the surcharge or the uh or the discount so here i'm going to say if you've asked for a surcharge you're going to add 50 people fair i probably don't want the bigger one i want the standard size one so add 50p to the fare and if you're going to get a discount it's going to be subtract 50p from the fair and i'll add some more arrows in so feel free to let us know in the comments what you think about the exam is there anything you think would be useful to go over i have been doing some uh examples of programming and programming some simple functions into a device but it's always interesting to hear what people struggle with i think this is a very complicated unit that people aren't always necessarily used to teaching i'm used to learning about it's it's often quite different but a lot of people do enjoy it i think it's a very good unit to include in an engineering degree because things are going towards industry 4.0 these days so i'll go through how these loops were because i think it might not be exactly obvious straight away so the device starts to count at 20 and it's going to check this thousands and thousands of times a second so it's going to see if you pressing the button if you press a pause button or a stop button there should be a stop here by the way so if you press pause or stop button it does an appropriate action if you press the pause button it goes back around and checks if you're going to press another button if you're not pressing any button it checking to see if 20 seconds have passed at the fare if it hasn't it's going to be looping around and most of the time it's going to be looping around this section here again and again and again and again and again and then every so often you'll have past 20 seconds and it's going to go this way and add 25 pence to the fair and actually i think at this point it will start count again from 20. so actually that's a little improvement i'm going to make there so it's going to come back here and it's going to start counting again from 20 and then it'll go round and round and round and round around this loop and then back up to here a stop button it stops a timer asks if you want to surcharge it says checks if you're going to press a button either for a surcharge or for a discount and if you want to surcharge it go around and i'll give you the option to do it again so you can add a surcharge add a surcharge add a surcharge i say charge oops i've added too much you can then start subtracting some fares as well the last thing we want to do is probably to display the fare so we're just going to put in display fare and after that what we're probably going to want to do is loop right back to the start because you can imagine the taxi driver would have another fare to come in so i'm going to start at the bottom of here and we're going to loop right the way back to the start so when i initiated use the journey again i don't want us going through everything so i'm going to drag this out to the side so now if i zoom out you can kind of see on the left hand side but we've got this flow chart here which is going through everything that's going on one last thing i might want to add in uh this is i suppose more for the higher marks but scientists think things that you can't quite get into the flowchart some information you can't quite get in so you might want to put a little note separate and it could be something to do with unexpected event so to work with the unexpected event of the wrong button being pressed at the wrong time the buttons will be specifically programs not to perform any functions when they are not supposed to be in use so what is saying is the stop timer button isn't going to be happening when you're looking for a surcharge or a surcharge or discount button isn't going to be happening when you're looking at this part up here and to get the top marks in this section you do need to mention the unexpected events so it's good to include that section here there's one last part that we need to do and that is to import into the workbook and the good way to do that if you press ctrl a we'll select everything on the page you see i've selected everything if i right click and i click save as picture i can save this as a picture a jpeg or a gif or something like that and i can import it directly as a picture into the document you want people edit the picture in the document but it will stop it from throwing things out and and really struggling to get everything on one page because the workbook that you use is quite difficult to use quite difficult to ensure that you are not going to be throwing things on the wrong page so we put it as one big image then it's just going to take a page and you'll be happy with that and that's about it this is possibly on the similar end of projects that you might get i'll often have more points to include but i think this demonstrates how you would write a program plan so i hope you've got something out of that in summary you're going to be creating a plan but it's definitely not actually doing the programming at this point that comes in activity 4 and we'll cover that in a later video what you're doing is creating a plan for your program and how you're going to answer things uh in activity 4 and to do this you'd create a flowchart with around 15 and 20 blocks perhaps with a coming in description i hope you found this useful and i hope you tune in for later videos and if you want to make sure you're going to hear where they are subscribe really helps channel and it'll keep you informed thanks again bye