[{"data":1,"prerenderedAt":2097},["ShallowReactive",2],{"tutorial:\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors":3,"tutorial-steps:\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors":684,"kit-\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors":1117,"key-words-glossary":1550,"glossary":1916},{"id":4,"title":5,"body":6,"description":662,"draft":665,"duration":666,"extension":667,"image":668,"kit":669,"language":673,"level":674,"meta":675,"navigation":676,"path":677,"pdf":678,"platform":679,"seo":680,"stem":681,"youtube":682,"__hash__":683},"tutorials\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002Findex.md","Code Rock Paper Scissors on a micro:bit with Python",{"type":7,"value":8,"toc":661},"minimark",[9],[10,11,12,107,113,120,178,198,229,283,325,379,423,467,503,535,560],"tutorial-steps",{},[13,14,16,26,42,45],"step",{"title":15},"Overview",[17,18,19,20,25],"p",{},"Can you beat a micro:bit at rock, paper, scissors? In this project you're going to find out, by coding your very own game on a ",[21,22,24],"g",{"slug":23},"micro-bit","micro:bit","!",[17,27,28,29,32,33,36,37,41],{},"Give your micro:bit a shake and the ",[21,30,31],{"slug":31},"accelerometer"," inside it feels the movement. Your code then picks rock, paper or scissors at ",[21,34,35],{"slug":35},"random"," and shows it as a little picture on the ",[21,38,40],{"slug":39},"led-matrix","LED matrix"," (the grid of lights on the front), so you can see straight away whether you've won.",[17,43,44],{},"The best bit? When you're done you'll have a real game you can play against your micro:bit, or challenge a friend. Don't worry if something doesn't work first time, that's all part of coding. Let's give it a go!",[46,47,50,56],"callout",{"color":48,"icon":49},"green","🎯",[17,51,52],{},[53,54,55],"strong",{},"What you'll learn",[57,58,59,67,75,81,84,87,95,102],"ul",{},[60,61,62,63],"li",{},"Bring in a ready-made library with ",[21,64,66],{"slug":65},"importing-libraries","importing libraries",[60,68,69,70,74],{},"Use a ",[21,71,73],{"slug":72},"while-loop","while loop"," to keep your game running",[60,76,77,78],{},"Make and use your own ",[21,79,80],{"slug":80},"variable",[60,82,83],{},"Use the micro:bit's shake sensor to spot movement",[60,85,86],{},"Draw your own pictures on the grid of lights",[60,88,89,90,94],{},"Make decisions with ",[21,91,93],{"slug":92},"if-statement","if statement","s, plus elif and else",[60,96,97,98],{},"Compare two things with a ",[21,99,101],{"slug":100},"comparison-operators","comparison operator",[60,103,104,105],{},"Let the micro:bit choose at ",[21,106,35],{"slug":35},[13,108,110],{"title":109},"What you'll need",[111,112],"what-youll-need",{},[13,114,116],{"title":115},"Key words",[117,118],"key-words",{"terms":119},"importing-libraries,variable,while-loop,accelerometer,random,if-statement,comparison-operators,led-matrix",[13,121,123,155,162,172],{"title":122},"Set up your micro:bit Python Editor",[124,125,126,129,142,148],"ol",{},[60,127,128],{},"Open your web browser. We recommend Google Chrome or Microsoft Edge.",[60,130,131,132,141],{},"In the address bar type ",[133,134,138],"a",{"href":135,"rel":136},"https:\u002F\u002Fpython.microbit.org",[137],"nofollow",[53,139,140],{},"python.microbit.org",".",[60,143,144,145,141],{},"Give your project a name: select the project name box at the top of the editor and type ",[53,146,147],{},"Rock Paper Scissors",[60,149,150,151,154],{},"Close the left-hand panel by selecting the ",[53,152,153],{},"arrow"," pointing to the left.",[17,156,157],{},[158,159],"img",{"alt":160,"src":161},"Closing the left-hand panel","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FClosingPanel.webp",[124,163,165],{"start":164},5,[60,166,167,168,171],{},"Delete the code on lines ",[53,169,170],{},"5 to 9"," in the main code area.",[17,173,174],{},[158,175],{"alt":176,"src":177},"The Python editor code area","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FCodeArea.webp",[13,179,181,192],{"title":180},"Import the random library",[17,182,183,184,188,189,191],{},"On line 3, type ",[185,186,187],"code",{},"import random",". This is ",[21,190,66],{"slug":65},", and it brings in the random library so the micro:bit can pick for itself later on.",[17,193,194],{},[158,195],{"alt":196,"src":197},"Importing the random library","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS1_ImportingPythonLibraries.webp",[13,199,201,223],{"title":200},"Create a while True loop",[17,202,203,204,207,208,211,212,214,215,218,219,222],{},"Type ",[185,205,206],{},"while True:"," and press ",[53,209,210],{},"Enter",". This creates a ",[21,213,73],{"slug":72},", so anything inside it runs while the condition stays true. Python needs the capital ",[53,216,217],{},"T"," in ",[185,220,221],{},"True"," and the colon at the end, or the code won't run. Notice your cursor automatically indents, that's how Python shows what's inside the loop.",[17,224,225],{},[158,226],{"alt":227,"src":228},"Creating a while True loop","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS2_CreateWhileLoop.webp",[13,230,232,238,266,277],{"title":231},"Create the picture variables",[17,233,234,235,237],{},"Each of these makes a ",[21,236,80],{"slug":80}," holding one of your pictures.",[124,239,240,250,258],{},[60,241,203,242,245,246,249],{},[185,243,244],{},"paper = Image(\"99999:90009:90009:90009:99999\")"," to create the ",[53,247,248],{},"paper"," icon.",[60,251,203,252,245,255,249],{},[185,253,254],{},"rock = Image(\"00000:09990:09990:09990:00000\")",[53,256,257],{},"rock",[60,259,203,260,245,263,249],{},[185,261,262],{},"scissors = Image(\"90099:09099:00900:09099:90099\")",[53,264,265],{},"scissors",[17,267,268,269,272,273,276],{},"The ",[53,270,271],{},"9","s are the lights that switch on and the ",[53,274,275],{},"0","s are the lights that stay off, so each row of numbers draws one row of the grid.",[17,278,279],{},[158,280],{"alt":281,"src":282},"Creating the picture variables","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS3_CreateVariables.webp",[13,284,286,319],{"title":285},"Detect a shake",[124,287,288,299],{},[60,289,203,290,207,293,295,296,298],{},[185,291,292],{},"if accelerometer.was_gesture(\"shake\"):",[53,294,210],{},". Keep it lined up with your picture variables. This ",[21,297,93],{"slug":92}," checks whether the micro:bit has been shaken.",[60,300,203,301,207,304,211,306,309,310,312,313,315,316,141],{},[185,302,303],{},"choice = random.randint(0, 2)",[53,305,210],{},[53,307,308],{},"choice"," variable and sets it to a ",[21,311,35],{"slug":35}," whole number between ",[53,314,275],{}," and ",[53,317,318],{},"2",[17,320,321],{},[158,322],{"alt":323,"src":324},"Detecting a shake and picking at random","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS4_DetectingAShake.webp",[13,326,328,359,373],{"title":327},"Show paper with an if statement",[124,329,330,346,353],{},[60,331,203,332,207,335,337,338,341,342,345],{},[185,333,334],{},"if choice == 0:",[53,336,210],{},". The ",[185,339,340],{},"=="," is a ",[21,343,101],{"slug":344},"comparison-operator",", and it checks whether the two things match.",[60,347,203,348,207,351,141],{},[185,349,350],{},"display.show(paper)",[53,352,210],{},[60,354,355,356,358],{},"Delete the indent so your cursor lines back up with the ",[185,357,334],{}," line.",[17,360,361,362,364,365,367,368,370,371,141],{},"Now, when ",[53,363,308],{}," is ",[53,366,275],{},", the ",[53,369,248],{}," icon appears on the ",[21,372,40],{"slug":39},[17,374,375],{},[158,376],{"alt":377,"src":378},"Showing paper with an if statement","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS5_CreateIfCondition.webp",[13,380,382,407,417],{"title":381},"Show rock with an elif statement",[124,383,384,396,403],{},[60,385,203,386,207,389,391,392,395],{},[185,387,388],{},"elif choice == 1:",[53,390,210],{},". ",[185,393,394],{},"elif"," is short for \"else if\", so this is the next check to try.",[60,397,203,398,207,401,141],{},[185,399,400],{},"display.show(rock)",[53,402,210],{},[60,404,355,405,358],{},[185,406,388],{},[17,408,361,409,364,411,367,414,416],{},[53,410,308],{},[53,412,413],{},"1",[53,415,257],{}," icon appears instead.",[17,418,419],{},[158,420],{"alt":421,"src":422},"Showing rock with an elif statement","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS6_CreateElifCondition.webp",[13,424,426,440,461],{"title":425},"Show scissors with an else statement",[124,427,428,435],{},[60,429,203,430,207,433,141],{},[185,431,432],{},"else:",[53,434,210],{},[60,436,203,437,141],{},[185,438,439],{},"display.show(scissors)",[17,441,442,445,446,448,449,451,452,454,455,457,458,460],{},[185,443,444],{},"else"," is the catch-all, so if ",[53,447,308],{}," isn't ",[53,450,275],{}," or ",[53,453,413],{}," it must be ",[53,456,318],{},", and the ",[53,459,265],{}," icon appears.",[17,462,463],{},[158,464],{"alt":465,"src":466},"Showing scissors with an else statement","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FS7_CreateElseCondition.webp",[13,468,470,497],{"title":469},"Downloading Your Code",[124,471,472,475,485,492],{},[60,473,474],{},"Connect the micro:bit to the computer with the micro USB cable.",[60,476,477,478,481,482,141],{},"Select the ",[53,479,480],{},"three dots"," next to ",[53,483,484],{},"Send to micro:bit",[60,486,487,488,491],{},"Select ",[53,489,490],{},"Connect"," and follow the on-screen prompts.",[60,493,487,494,496],{},[53,495,484],{}," to download the code.",[17,498,499],{},[158,500],{"alt":501,"src":502},"Downloading your code","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FDownloadingCode.webp",[13,504,506,511,522,528,532],{"title":505},"Run it and Play",[507,508,510],"h3",{"id":509},"in-the-web-browser","In the web browser",[17,512,513,514,517,518,521],{},"The Python editor has a built-in micro:bit simulator, handy if you haven't got a micro:bit to hand. Below the simulator you'll see the ",[53,515,516],{},"shake"," function is already selected. Select the ",[53,519,520],{},"play"," button next to it to simulate a shake and watch paper, rock or scissors appear on the LED matrix.",[17,523,524],{},[158,525],{"alt":526,"src":527},"The Python editor simulator","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FSimulatorDemo.webp",[507,529,531],{"id":530},"on-a-real-microbit","On a real micro:bit",[17,533,534],{},"Once your code's downloaded, give the micro:bit a shake and see what it picks. Remember the choice is random, so you might get the same icon twice in a row, that's completely normal. Why not find a friend and see who can beat the micro:bit?",[13,536,538],{"title":537},"Try it yourself",[539,540,541,554],"try-it",{},[17,542,543,546,547,550,551,553],{},[53,544,545],{},"Challenge:"," Give your micro:bit a voice! Add an ",[185,548,549],{},"audio.play(Sound.HAPPY)"," line inside your ",[185,552,292],{}," check, just after you set the choice, so it beeps every time it plays. For an extra challenge, pick a different sound for rock, paper and scissors.",[17,555,556],{},[557,558,559],"em",{},"Good to know: the sound plays through the built-in speaker, which only the micro:bit V2 has. If you've got a V1, you can still try this by clipping a buzzer or headphones to the pins. Everything else in this project works happily on both.",[13,561,563],{"title":562},"Stuck? Quick fixes",[564,565,566,579],"table",{},[567,568,569],"thead",{},[570,571,572,576],"tr",{},[573,574,575],"th",{},"Problem",[573,577,578],{},"Try this",[580,581,582,593,601,613,637,653],"tbody",{},[570,583,584,588],{},[585,586,587],"td",{},"Nothing happens when I shake it",[585,589,590,591,358],{},"Give the micro:bit one firm, clear shake, not too gentle. Also check your code is indented inside the ",[185,592,292],{},[570,594,595,598],{},[585,596,597],{},"The same icon keeps showing",[585,599,600],{},"That's okay, it's working! The choice is random, so shake a few more times and the others will turn up.",[570,602,603,606],{},[585,604,605],{},"My icons look wrong or blank",[585,607,608,609,612],{},"Check each ",[185,610,611],{},"Image(\"...\")"," line and make sure the 9s and 0s match the pattern for rock, paper and scissors, with a colon between each row.",[570,614,615,618],{},[585,616,617],{},"It only ever shows two icons",[585,619,620,621,623,624,627,628,631,632,634,635,141],{},"Check your ",[185,622,394],{}," is set to ",[185,625,626],{},"choice == 1",", and that ",[185,629,630],{},"random.randint"," goes from ",[53,633,275],{}," to ",[53,636,318],{},[570,638,639,644],{},[585,640,641,642],{},"I get an error about ",[185,643,35],{},[585,645,646,647,649,650,652],{},"Check ",[185,648,187],{}," is on its own line at the top, above your ",[185,651,206],{}," loop, and spelled all in lower case.",[570,654,655,658],{},[585,656,657],{},"My code won't download to the micro:bit",[585,659,660],{},"Use a data USB cable (not a charge-only one), make sure the micro:bit is paired, and try a different USB port.",{"title":662,"searchDepth":663,"depth":663,"links":664},"",2,[],false,"10 mins","md","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002FRockPaperScissors_Cover.png",[670,24,671,672],"The micro:bit Python editor","micro USB cable","battery pack for the micro:bit (optional)","python","Beginner",{},true,"\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors","\u002Flearn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002Frock-paper-scissors.pdf","microbit",{"title":5,"description":662},"learn\u002Fmicrobit\u002Fpython\u002Frock-paper-scissors\u002Findex",null,"cqVSfIx61YAci3SpoiOvQ6kaoofOfsHD4nHYb9vcYjY",{"id":4,"title":5,"body":685,"description":662,"draft":665,"duration":666,"extension":667,"image":668,"kit":1114,"language":673,"level":674,"meta":1115,"navigation":676,"path":677,"pdf":678,"platform":679,"seo":1116,"stem":681,"youtube":682,"__hash__":683},{"type":7,"value":686,"toc":1112},[687],[10,688,689,741,745,749,784,796,814,850,880,918,952,984,1008,1026,1042],{},[13,690,691,695,703,705],{"title":15},[17,692,19,693,25],{},[21,694,24],{"slug":23},[17,696,28,697,32,699,36,701,41],{},[21,698,31],{"slug":31},[21,700,35],{"slug":35},[21,702,40],{"slug":39},[17,704,44],{},[46,706,707,711],{"color":48,"icon":49},[17,708,709],{},[53,710,55],{},[57,712,713,717,721,725,727,729,733,737],{},[60,714,62,715],{},[21,716,66],{"slug":65},[60,718,69,719,74],{},[21,720,73],{"slug":72},[60,722,77,723],{},[21,724,80],{"slug":80},[60,726,83],{},[60,728,86],{},[60,730,89,731,94],{},[21,732,93],{"slug":92},[60,734,97,735],{},[21,736,101],{"slug":100},[60,738,104,739],{},[21,740,35],{"slug":35},[13,742,743],{"title":109},[111,744],{},[13,746,747],{"title":115},[117,748],{"terms":119},[13,750,751,770,774,780],{"title":122},[124,752,753,755,762,766],{},[60,754,128],{},[60,756,131,757,141],{},[133,758,760],{"href":135,"rel":759},[137],[53,761,140],{},[60,763,144,764,141],{},[53,765,147],{},[60,767,150,768,154],{},[53,769,153],{},[17,771,772],{},[158,773],{"alt":160,"src":161},[124,775,776],{"start":164},[60,777,167,778,171],{},[53,779,170],{},[17,781,782],{},[158,783],{"alt":176,"src":177},[13,785,786,792],{"title":180},[17,787,183,788,188,790,191],{},[185,789,187],{},[21,791,66],{"slug":65},[17,793,794],{},[158,795],{"alt":196,"src":197},[13,797,798,810],{"title":200},[17,799,203,800,207,802,211,804,214,806,218,808,222],{},[185,801,206],{},[53,803,210],{},[21,805,73],{"slug":72},[53,807,217],{},[185,809,221],{},[17,811,812],{},[158,813],{"alt":227,"src":228},[13,815,816,820,840,846],{"title":231},[17,817,234,818,237],{},[21,819,80],{"slug":80},[124,821,822,828,834],{},[60,823,203,824,245,826,249],{},[185,825,244],{},[53,827,248],{},[60,829,203,830,245,832,249],{},[185,831,254],{},[53,833,257],{},[60,835,203,836,245,838,249],{},[185,837,262],{},[53,839,265],{},[17,841,268,842,272,844,276],{},[53,843,271],{},[53,845,275],{},[17,847,848],{},[158,849],{"alt":281,"src":282},[13,851,852,876],{"title":285},[124,853,854,862],{},[60,855,203,856,207,858,295,860,298],{},[185,857,292],{},[53,859,210],{},[21,861,93],{"slug":92},[60,863,203,864,207,866,211,868,309,870,312,872,315,874,141],{},[185,865,303],{},[53,867,210],{},[53,869,308],{},[21,871,35],{"slug":35},[53,873,275],{},[53,875,318],{},[17,877,878],{},[158,879],{"alt":323,"src":324},[13,881,882,904,914],{"title":327},[124,883,884,894,900],{},[60,885,203,886,207,888,337,890,341,892,345],{},[185,887,334],{},[53,889,210],{},[185,891,340],{},[21,893,101],{"slug":344},[60,895,203,896,207,898,141],{},[185,897,350],{},[53,899,210],{},[60,901,355,902,358],{},[185,903,334],{},[17,905,361,906,364,908,367,910,370,912,141],{},[53,907,308],{},[53,909,275],{},[53,911,248],{},[21,913,40],{"slug":39},[17,915,916],{},[158,917],{"alt":377,"src":378},[13,919,920,940,948],{"title":381},[124,921,922,930,936],{},[60,923,203,924,207,926,391,928,395],{},[185,925,388],{},[53,927,210],{},[185,929,394],{},[60,931,203,932,207,934,141],{},[185,933,400],{},[53,935,210],{},[60,937,355,938,358],{},[185,939,388],{},[17,941,361,942,364,944,367,946,416],{},[53,943,308],{},[53,945,413],{},[53,947,257],{},[17,949,950],{},[158,951],{"alt":421,"src":422},[13,953,954,966,980],{"title":425},[124,955,956,962],{},[60,957,203,958,207,960,141],{},[185,959,432],{},[53,961,210],{},[60,963,203,964,141],{},[185,965,439],{},[17,967,968,445,970,448,972,451,974,454,976,457,978,460],{},[185,969,444],{},[53,971,308],{},[53,973,275],{},[53,975,413],{},[53,977,318],{},[53,979,265],{},[17,981,982],{},[158,983],{"alt":465,"src":466},[13,985,986,1004],{"title":469},[124,987,988,990,996,1000],{},[60,989,474],{},[60,991,477,992,481,994,141],{},[53,993,480],{},[53,995,484],{},[60,997,487,998,491],{},[53,999,490],{},[60,1001,487,1002,496],{},[53,1003,484],{},[17,1005,1006],{},[158,1007],{"alt":501,"src":502},[13,1009,1010,1012,1018,1022,1024],{"title":505},[507,1011,510],{"id":509},[17,1013,513,1014,517,1016,521],{},[53,1015,516],{},[53,1017,520],{},[17,1019,1020],{},[158,1021],{"alt":526,"src":527},[507,1023,531],{"id":530},[17,1025,534],{},[13,1027,1028],{"title":537},[539,1029,1030,1038],{},[17,1031,1032,546,1034,550,1036,553],{},[53,1033,545],{},[185,1035,549],{},[185,1037,292],{},[17,1039,1040],{},[557,1041,559],{},[13,1043,1044],{"title":562},[564,1045,1046,1054],{},[567,1047,1048],{},[570,1049,1050,1052],{},[573,1051,575],{},[573,1053,578],{},[580,1055,1056,1064,1070,1078,1094,1106],{},[570,1057,1058,1060],{},[585,1059,587],{},[585,1061,590,1062,358],{},[185,1063,292],{},[570,1065,1066,1068],{},[585,1067,597],{},[585,1069,600],{},[570,1071,1072,1074],{},[585,1073,605],{},[585,1075,608,1076,612],{},[185,1077,611],{},[570,1079,1080,1082],{},[585,1081,617],{},[585,1083,620,1084,623,1086,627,1088,631,1090,634,1092,141],{},[185,1085,394],{},[185,1087,626],{},[185,1089,630],{},[53,1091,275],{},[53,1093,318],{},[570,1095,1096,1100],{},[585,1097,641,1098],{},[185,1099,35],{},[585,1101,646,1102,649,1104,652],{},[185,1103,187],{},[185,1105,206],{},[570,1107,1108,1110],{},[585,1109,657],{},[585,1111,660],{},{"title":662,"searchDepth":663,"depth":663,"links":1113},[],[670,24,671,672],{},{"title":5,"description":662},{"id":4,"title":5,"body":1118,"description":662,"draft":665,"duration":666,"extension":667,"image":668,"kit":1547,"language":673,"level":674,"meta":1548,"navigation":676,"path":677,"pdf":678,"platform":679,"seo":1549,"stem":681,"youtube":682,"__hash__":683},{"type":7,"value":1119,"toc":1545},[1120],[10,1121,1122,1174,1178,1182,1217,1229,1247,1283,1313,1351,1385,1417,1441,1459,1475],{},[13,1123,1124,1128,1136,1138],{"title":15},[17,1125,19,1126,25],{},[21,1127,24],{"slug":23},[17,1129,28,1130,32,1132,36,1134,41],{},[21,1131,31],{"slug":31},[21,1133,35],{"slug":35},[21,1135,40],{"slug":39},[17,1137,44],{},[46,1139,1140,1144],{"color":48,"icon":49},[17,1141,1142],{},[53,1143,55],{},[57,1145,1146,1150,1154,1158,1160,1162,1166,1170],{},[60,1147,62,1148],{},[21,1149,66],{"slug":65},[60,1151,69,1152,74],{},[21,1153,73],{"slug":72},[60,1155,77,1156],{},[21,1157,80],{"slug":80},[60,1159,83],{},[60,1161,86],{},[60,1163,89,1164,94],{},[21,1165,93],{"slug":92},[60,1167,97,1168],{},[21,1169,101],{"slug":100},[60,1171,104,1172],{},[21,1173,35],{"slug":35},[13,1175,1176],{"title":109},[111,1177],{},[13,1179,1180],{"title":115},[117,1181],{"terms":119},[13,1183,1184,1203,1207,1213],{"title":122},[124,1185,1186,1188,1195,1199],{},[60,1187,128],{},[60,1189,131,1190,141],{},[133,1191,1193],{"href":135,"rel":1192},[137],[53,1194,140],{},[60,1196,144,1197,141],{},[53,1198,147],{},[60,1200,150,1201,154],{},[53,1202,153],{},[17,1204,1205],{},[158,1206],{"alt":160,"src":161},[124,1208,1209],{"start":164},[60,1210,167,1211,171],{},[53,1212,170],{},[17,1214,1215],{},[158,1216],{"alt":176,"src":177},[13,1218,1219,1225],{"title":180},[17,1220,183,1221,188,1223,191],{},[185,1222,187],{},[21,1224,66],{"slug":65},[17,1226,1227],{},[158,1228],{"alt":196,"src":197},[13,1230,1231,1243],{"title":200},[17,1232,203,1233,207,1235,211,1237,214,1239,218,1241,222],{},[185,1234,206],{},[53,1236,210],{},[21,1238,73],{"slug":72},[53,1240,217],{},[185,1242,221],{},[17,1244,1245],{},[158,1246],{"alt":227,"src":228},[13,1248,1249,1253,1273,1279],{"title":231},[17,1250,234,1251,237],{},[21,1252,80],{"slug":80},[124,1254,1255,1261,1267],{},[60,1256,203,1257,245,1259,249],{},[185,1258,244],{},[53,1260,248],{},[60,1262,203,1263,245,1265,249],{},[185,1264,254],{},[53,1266,257],{},[60,1268,203,1269,245,1271,249],{},[185,1270,262],{},[53,1272,265],{},[17,1274,268,1275,272,1277,276],{},[53,1276,271],{},[53,1278,275],{},[17,1280,1281],{},[158,1282],{"alt":281,"src":282},[13,1284,1285,1309],{"title":285},[124,1286,1287,1295],{},[60,1288,203,1289,207,1291,295,1293,298],{},[185,1290,292],{},[53,1292,210],{},[21,1294,93],{"slug":92},[60,1296,203,1297,207,1299,211,1301,309,1303,312,1305,315,1307,141],{},[185,1298,303],{},[53,1300,210],{},[53,1302,308],{},[21,1304,35],{"slug":35},[53,1306,275],{},[53,1308,318],{},[17,1310,1311],{},[158,1312],{"alt":323,"src":324},[13,1314,1315,1337,1347],{"title":327},[124,1316,1317,1327,1333],{},[60,1318,203,1319,207,1321,337,1323,341,1325,345],{},[185,1320,334],{},[53,1322,210],{},[185,1324,340],{},[21,1326,101],{"slug":344},[60,1328,203,1329,207,1331,141],{},[185,1330,350],{},[53,1332,210],{},[60,1334,355,1335,358],{},[185,1336,334],{},[17,1338,361,1339,364,1341,367,1343,370,1345,141],{},[53,1340,308],{},[53,1342,275],{},[53,1344,248],{},[21,1346,40],{"slug":39},[17,1348,1349],{},[158,1350],{"alt":377,"src":378},[13,1352,1353,1373,1381],{"title":381},[124,1354,1355,1363,1369],{},[60,1356,203,1357,207,1359,391,1361,395],{},[185,1358,388],{},[53,1360,210],{},[185,1362,394],{},[60,1364,203,1365,207,1367,141],{},[185,1366,400],{},[53,1368,210],{},[60,1370,355,1371,358],{},[185,1372,388],{},[17,1374,361,1375,364,1377,367,1379,416],{},[53,1376,308],{},[53,1378,413],{},[53,1380,257],{},[17,1382,1383],{},[158,1384],{"alt":421,"src":422},[13,1386,1387,1399,1413],{"title":425},[124,1388,1389,1395],{},[60,1390,203,1391,207,1393,141],{},[185,1392,432],{},[53,1394,210],{},[60,1396,203,1397,141],{},[185,1398,439],{},[17,1400,1401,445,1403,448,1405,451,1407,454,1409,457,1411,460],{},[185,1402,444],{},[53,1404,308],{},[53,1406,275],{},[53,1408,413],{},[53,1410,318],{},[53,1412,265],{},[17,1414,1415],{},[158,1416],{"alt":465,"src":466},[13,1418,1419,1437],{"title":469},[124,1420,1421,1423,1429,1433],{},[60,1422,474],{},[60,1424,477,1425,481,1427,141],{},[53,1426,480],{},[53,1428,484],{},[60,1430,487,1431,491],{},[53,1432,490],{},[60,1434,487,1435,496],{},[53,1436,484],{},[17,1438,1439],{},[158,1440],{"alt":501,"src":502},[13,1442,1443,1445,1451,1455,1457],{"title":505},[507,1444,510],{"id":509},[17,1446,513,1447,517,1449,521],{},[53,1448,516],{},[53,1450,520],{},[17,1452,1453],{},[158,1454],{"alt":526,"src":527},[507,1456,531],{"id":530},[17,1458,534],{},[13,1460,1461],{"title":537},[539,1462,1463,1471],{},[17,1464,1465,546,1467,550,1469,553],{},[53,1466,545],{},[185,1468,549],{},[185,1470,292],{},[17,1472,1473],{},[557,1474,559],{},[13,1476,1477],{"title":562},[564,1478,1479,1487],{},[567,1480,1481],{},[570,1482,1483,1485],{},[573,1484,575],{},[573,1486,578],{},[580,1488,1489,1497,1503,1511,1527,1539],{},[570,1490,1491,1493],{},[585,1492,587],{},[585,1494,590,1495,358],{},[185,1496,292],{},[570,1498,1499,1501],{},[585,1500,597],{},[585,1502,600],{},[570,1504,1505,1507],{},[585,1506,605],{},[585,1508,608,1509,612],{},[185,1510,611],{},[570,1512,1513,1515],{},[585,1514,617],{},[585,1516,620,1517,623,1519,627,1521,631,1523,634,1525,141],{},[185,1518,394],{},[185,1520,626],{},[185,1522,630],{},[53,1524,275],{},[53,1526,318],{},[570,1528,1529,1533],{},[585,1530,641,1531],{},[185,1532,35],{},[585,1534,646,1535,649,1537,652],{},[185,1536,187],{},[185,1538,206],{},[570,1540,1541,1543],{},[585,1542,657],{},[585,1544,660],{},{"title":662,"searchDepth":663,"depth":663,"links":1546},[],[670,24,671,672],{},{"title":5,"description":662},[1551,1564,1576,1588,1601,1614,1627,1639,1652,1664,1676,1689,1701,1713,1725,1736,1748,1760,1772,1784,1796,1808,1820,1832,1844,1856,1868,1880,1892,1904],{"id":1552,"category":1553,"definition":1554,"example":1555,"extension":667,"meta":1556,"stem":1561,"term":1562,"__hash__":1563},"glossary\u002Fglossary\u002Faccelerometer.md","Hardware","An accelerometer is a tiny part inside the micro:bit that senses movement, like tilting, shaking or being turned over. It turns that movement into numbers your code can react to.","A bit like the sensor in a games controller that knows when you tilt it to steer, the accelerometer notices when the micro:bit moves.",{"body":1557},{"type":7,"value":1558,"toc":1559},[],{"title":662,"searchDepth":663,"depth":663,"links":1560},[],"glossary\u002Faccelerometer","Accelerometer","ksJj58OEPP72c3cASeHPlPiw73FfxxUbtIkoEIYW2Rc",{"id":1565,"category":1553,"definition":1566,"example":1567,"extension":667,"meta":1568,"stem":1573,"term":1574,"__hash__":1575},"glossary\u002Fglossary\u002Fbutton.md","A button is a switch you press to tell your project to do something. The code can check whether it's being pressed or not.","Pressing a doorbell is just like pressing a button, one press sends a signal that makes something happen.",{"body":1569},{"type":7,"value":1570,"toc":1571},[],{"title":662,"searchDepth":663,"depth":663,"links":1572},[],"glossary\u002Fbutton","Button","PgfcNSpG1mpSW_fVJZZMkF4D6eYiQLiyKWeq6_CXsMA",{"id":1577,"category":1553,"definition":1578,"example":1579,"extension":667,"meta":1580,"stem":1585,"term":1586,"__hash__":1587},"glossary\u002Fglossary\u002Fbuzzer.md","A buzzer is a tiny speaker that makes beeps and tones when you send it electricity. By telling it different numbers, you can make it play notes and tunes.","The beep a microwave makes when your food is ready comes from a buzzer.",{"body":1581},{"type":7,"value":1582,"toc":1583},[],{"title":662,"searchDepth":663,"depth":663,"links":1584},[],"glossary\u002Fbuzzer","Buzzer","L0-h_InzgZ_gB0Iy3IE-ojdFF0cXjdB2AxJY0QU0VpU",{"id":1589,"category":1590,"definition":1591,"example":1592,"extension":667,"meta":1593,"stem":1598,"term":1599,"__hash__":1600},"glossary\u002Fglossary\u002Fcomparison-operators.md","Logic","A comparison operator checks how two things measure up, for example whether they are equal or one is bigger than the other. It gives back a simple true or false answer.","Asking \"is 6 == 6?\" gives back true, but \"is 6 == 2?\" gives back false, so your code knows whether the two numbers match.",{"body":1594},{"type":7,"value":1595,"toc":1596},[],{"title":662,"searchDepth":663,"depth":663,"links":1597},[],"glossary\u002Fcomparison-operators","Comparison Operators","PPG3NDp3Xsx9FclsvC7ertn8IDeBVjhCknFTN17UIaU",{"id":1602,"category":1603,"definition":1604,"example":1605,"extension":667,"meta":1606,"stem":1611,"term":1612,"__hash__":1613},"glossary\u002Fglossary\u002Fforever-loop.md","Programming","A forever loop repeats its instructions again and again without ever stopping (until you switch off or reset). It's perfect for anything you want to keep happening over and over.","Like a clock's second hand that keeps ticking round and round, a forever loop keeps running the same steps over and over.",{"body":1607},{"type":7,"value":1608,"toc":1609},[],{"title":662,"searchDepth":663,"depth":663,"links":1610},[],"glossary\u002Fforever-loop","Forever loop","1j2cYaiR3yKeoh54w9Vg2aWr_cEXEtj7F0WCR3_jdc0",{"id":1615,"category":1616,"definition":1617,"example":1618,"extension":667,"meta":1619,"stem":1624,"term":1625,"__hash__":1626},"glossary\u002Fglossary\u002Ffrequency.md","Electronics","A frequency is just a number that tells a buzzer which note to play. A small number makes a low sound, and a big number makes a high sound.","Setting a buzzer to a low number gives a deep, rumbly note, while a high number makes a squeaky, high-pitched one, a bit like the left and right ends of a piano.",{"body":1620},{"type":7,"value":1621,"toc":1622},[],{"title":662,"searchDepth":663,"depth":663,"links":1623},[],"glossary\u002Ffrequency","Frequency","XY4AeY0bsJaqF0XBjkEAvTSzqxdpPPLt09Z_LbZSjPg",{"id":1628,"category":1603,"definition":1629,"example":1630,"extension":667,"meta":1631,"stem":1636,"term":1637,"__hash__":1638},"glossary\u002Fglossary\u002Ffunction.md","A function is a chunk of code you give a name to, so you can use it again and again without building it from scratch each time. Think of it like a favourite recipe, you write down the steps once, then follow it whenever you need it.","Like writing out a pancake recipe once. Whenever you fancy pancakes, you just follow the recipe again rather than working it all out from scratch.",{"body":1632},{"type":7,"value":1633,"toc":1634},[],{"title":662,"searchDepth":663,"depth":663,"links":1635},[],"glossary\u002Ffunction","Function","0aEVvGRMWsAC1qXngj6QCHxCoIn1mWfHYBBi95ayuLE",{"id":1640,"category":1641,"definition":1642,"example":1643,"extension":667,"meta":1644,"stem":1649,"term":1650,"__hash__":1651},"glossary\u002Fglossary\u002Fide-code-editor.md","General","An IDE is the program where you write and run your code. A code editor lots of children and parents will already know is Scratch, where you drag blocks together to build a program. IDE stands for \"integrated development environment\".","It's like a kitchen for code: one place with all the tools you need to put your project together and test it.",{"body":1645},{"type":7,"value":1646,"toc":1647},[],{"title":662,"searchDepth":663,"depth":663,"links":1648},[],"glossary\u002Fide-code-editor","IDE (code editor)","yc7Eds8WdmrIM56FGlCmMtjhoodKwT1IUvQCC9bsvKs",{"id":1653,"category":1590,"definition":1654,"example":1655,"extension":667,"meta":1656,"stem":1661,"term":1662,"__hash__":1663},"glossary\u002Fglossary\u002Fif-statement.md","An if statement checks whether something is true, and only runs its instructions when it is. It's how code makes decisions.","\"If it's cold, put on a coat.\" If it's warm, you skip the coat, the action only happens when the check is true.",{"body":1657},{"type":7,"value":1658,"toc":1659},[],{"title":662,"searchDepth":663,"depth":663,"links":1660},[],"glossary\u002Fif-statement","If statement","3uYmpX5sGUnkc327qCP_EkL6IGkFiginfOP39Kstry8",{"id":1665,"category":1603,"definition":1666,"example":1667,"extension":667,"meta":1668,"stem":1673,"term":1674,"__hash__":1675},"glossary\u002Fglossary\u002Fimporting-libraries.md","A library is a ready-made bundle of code that someone else has written for you. Importing a library means bringing it into your project so you can use all its ready-made commands and features, without building them from scratch.","It's like borrowing a recipe book from the library. Instead of working out every recipe yourself, you bring the book in and use the recipes whenever you need them.",{"body":1669},{"type":7,"value":1670,"toc":1671},[],{"title":662,"searchDepth":663,"depth":663,"links":1672},[],"glossary\u002Fimporting-libraries","Importing Libraries","Wqj3o2kxbFQa44LtzhYfeDYluwIPxxWChkL00OD1LqI",{"id":1677,"category":1678,"definition":1679,"example":1680,"extension":667,"meta":1681,"stem":1686,"term":1687,"__hash__":1688},"glossary\u002Fglossary\u002Finteger.md","Data & Variables","An integer is just a whole number, like 1, 2 or 3. It has no bits after a dot, so 4 is an integer, but 4.5 isn't.","Counting down 3… 2… 1… uses integers, but a price like £4.99 isn't an integer because it has numbers after the dot.",{"body":1682},{"type":7,"value":1683,"toc":1684},[],{"title":662,"searchDepth":663,"depth":663,"links":1685},[],"glossary\u002Finteger","Integer","lktbVeg3VEBLF2Jg3R_EKdjEowVZeabE1gPnGpI2OXY",{"id":1690,"category":1553,"definition":1691,"example":1692,"extension":667,"meta":1693,"stem":1698,"term":1699,"__hash__":1700},"glossary\u002Fglossary\u002Fled.md","An LED is a tiny light you can switch on and off (and sometimes change colour) with your code. LED is short for \"light-emitting diode\".","The little standby light on a TV is an LED, your code can flash one on and off the same way.",{"body":1694},{"type":7,"value":1695,"toc":1696},[],{"title":662,"searchDepth":663,"depth":663,"links":1697},[],"glossary\u002Fled","LED","M41j-xq46HhMvOjtpYSjfy0ypnoMYVzgeqVGSuyVciY",{"id":1702,"category":1553,"definition":1703,"example":1704,"extension":667,"meta":1705,"stem":1710,"term":1711,"__hash__":1712},"glossary\u002Fglossary\u002Fled-matrix.md","The LED matrix is the grid of little red lights on the front of the micro:bit. By switching them on and off in patterns, your code can show numbers, letters and tiny pictures.","Like a mini scoreboard made of dots, the LED matrix lights up to spell out your step count.",{"body":1706},{"type":7,"value":1707,"toc":1708},[],{"title":662,"searchDepth":663,"depth":663,"links":1709},[],"glossary\u002Fled-matrix","LED Matrix","KfPJAm7v5EXlm2ejZZLldfB4w7zOMZQhbrmsqxpqJi8",{"id":1714,"category":1553,"definition":1715,"example":1716,"extension":667,"meta":1717,"stem":1722,"term":1723,"__hash__":1724},"glossary\u002Fglossary\u002Flight-sensor.md","A light sensor is a little part that measures how bright or dark it is around it, then turns that into a number your code can read. As the light changes, so does the number.","Like the automatic headlights on a car that switch on when it gets dark, a light sensor notices the light dropping and lets your code react.",{"body":1718},{"type":7,"value":1719,"toc":1720},[],{"title":662,"searchDepth":663,"depth":663,"links":1721},[],"glossary\u002Flight-sensor","Light Sensor","tEERMTJO24JmYYlQoIO7DxY9yXg0GNehs78E_LQL28U",{"id":1726,"category":1553,"definition":1727,"example":1728,"extension":667,"meta":1729,"stem":1734,"term":24,"__hash__":1735},"glossary\u002Fglossary\u002Fmicro-bit.md","The micro:bit is a tiny programmable computer, about the size of a matchbox, made for learning to code. It has two buttons, a grid of little red LED lights and built-in sensors that can detect movement, light and temperature.","A bit like a pocket-sized computer you can program yourself, a micro:bit can become a step counter, a thermometer or even a simple game.",{"body":1730},{"type":7,"value":1731,"toc":1732},[],{"title":662,"searchDepth":663,"depth":663,"links":1733},[],"glossary\u002Fmicro-bit","GZPIPrw-9_LkW4seKGxZt6hAdg8MO_A_wOS-mN4qDTg",{"id":1737,"category":1641,"definition":1738,"example":1739,"extension":667,"meta":1740,"stem":1745,"term":1746,"__hash__":1747},"glossary\u002Fglossary\u002Fmillisecond.md","A millisecond is a tiny slice of time. There are 1,000 of them in just one second! That's why it's perfect for measuring things that happen really fast.","A blink of an eye takes around 300 milliseconds, so a really quick button press might be even faster than a blink.",{"body":1741},{"type":7,"value":1742,"toc":1743},[],{"title":662,"searchDepth":663,"depth":663,"links":1744},[],"glossary\u002Fmillisecond","Millisecond","2TwuImc8S9MyMSqRFO3i6iHVCdsxyJ_S9N_BxGbZL-8",{"id":1749,"category":1553,"definition":1750,"example":1751,"extension":667,"meta":1752,"stem":1757,"term":1758,"__hash__":1759},"glossary\u002Fglossary\u002Fmodule.md","A module is a small part that does one job, like a buzzer, a button or a screen. You connect modules to the main board to give your project new powers.","Like adding different attachments to a toy, each module snaps on to add a new ability, sound, light or buttons.",{"body":1753},{"type":7,"value":1754,"toc":1755},[],{"title":662,"searchDepth":663,"depth":663,"links":1756},[],"glossary\u002Fmodule","Module","IDLrS2CrlwNauzAWoCd7V16aO_ygDWyjp11bMsfuwO0",{"id":1761,"category":1553,"definition":1762,"example":1763,"extension":667,"meta":1764,"stem":1769,"term":1770,"__hash__":1771},"glossary\u002Fglossary\u002Fmotor-controller.md","A motor controller is the part that sits between your board and a motor, passing on the right amount of power so the motor moves the way your code asks.","Like a remote control for a toy car, it takes your instructions and makes the motor do them.",{"body":1765},{"type":7,"value":1766,"toc":1767},[],{"title":662,"searchDepth":663,"depth":663,"links":1768},[],"glossary\u002Fmotor-controller","Motor controller","McSSBLd3fPtYq-o2LUQBhW3pBeEmMSjF6cnb2O9ectE",{"id":1773,"category":1553,"definition":1774,"example":1775,"extension":667,"meta":1776,"stem":1781,"term":1782,"__hash__":1783},"glossary\u002Fglossary\u002Foled-screen.md","An OLED screen is a small display that shows words, numbers and pictures from your code. On some kits it's labelled the \"LED display\", but it's the same little screen.","Like the small screen on a fitness watch showing your steps, an OLED screen can show a score or a countdown.",{"body":1777},{"type":7,"value":1778,"toc":1779},[],{"title":662,"searchDepth":663,"depth":663,"links":1780},[],"glossary\u002Foled-screen","OLED screen","14SaCtmWj71MOziFuPIW377cynK4FRv5TsdEx4fGGFk",{"id":1785,"category":1553,"definition":1786,"example":1787,"extension":667,"meta":1788,"stem":1793,"term":1794,"__hash__":1795},"glossary\u002Fglossary\u002Fpicobricks.md","PicoBricks is an all-in-one coding kit that joins up handy parts, like a screen, a buzzer, buttons and lights, onto one board, so you can build projects without any fiddly wiring.","It's a bit like a Lego baseboard for electronics: everything clicks together in one place, ready to code.",{"body":1789},{"type":7,"value":1790,"toc":1791},[],{"title":662,"searchDepth":663,"depth":663,"links":1792},[],"glossary\u002Fpicobricks","PicoBricks","TeGs24I-3fkAdlpiuQPPBDUO8EKBe8PS1ewHaj-w5_s",{"id":1797,"category":1553,"definition":1798,"example":1799,"extension":667,"meta":1800,"stem":1805,"term":1806,"__hash__":1807},"glossary\u002Fglossary\u002Fpotentiometer.md","A potentiometer is a knob or dial that controls how much electricity flows through a circuit. Think of it like a tap for water: turn it one way and more comes out, turn it the other way and less comes out.","A volume dial on a speaker is a potentiometer, turn it up for louder sound and down for quieter.",{"body":1801},{"type":7,"value":1802,"toc":1803},[],{"title":662,"searchDepth":663,"depth":663,"links":1804},[],"glossary\u002Fpotentiometer","Potentiometer","ohP2krcKZLkMtpI44R32nhDVwImLmSBQWP6SOArsh6M",{"id":1809,"category":1603,"definition":1810,"example":1811,"extension":667,"meta":1812,"stem":1817,"term":1818,"__hash__":1819},"glossary\u002Fglossary\u002Frandom.md","Random means you can't guess what's coming next, a bit like rolling a dice. The computer picks for you, so you get a different surprise each time.","Asking a computer for a random number between 1 and 6 is just like rolling a dice, you never know if you'll get a 1 or a 6.",{"body":1813},{"type":7,"value":1814,"toc":1815},[],{"title":662,"searchDepth":663,"depth":663,"links":1816},[],"glossary\u002Frandom","Random","LkGfQKwUNfJ_TPXihwPveX2JeJ9-BB7DpUire9a2pqI",{"id":1821,"category":1553,"definition":1822,"example":1823,"extension":667,"meta":1824,"stem":1829,"term":1830,"__hash__":1831},"glossary\u002Fglossary\u002Fraspberry-pi-pico.md","The Raspberry Pi Pico is a tiny, low-cost computer chip on a small board. It's the \"brain\" that stores your code and tells the other parts what to do.","It's like the brain inside a toy robot, small enough to fit in your hand, but clever enough to run your whole project.",{"body":1825},{"type":7,"value":1826,"toc":1827},[],{"title":662,"searchDepth":663,"depth":663,"links":1828},[],"glossary\u002Fraspberry-pi-pico","Raspberry Pi Pico","HVa7r-PC6I5-DVcDdOULsBHP6h7V4SafhFtdazcSWYg",{"id":1833,"category":1603,"definition":1834,"example":1835,"extension":667,"meta":1836,"stem":1841,"term":1842,"__hash__":1843},"glossary\u002Fglossary\u002Frepeat-loop.md","A repeat loop does its instructions a set number of times, then stops. You tell it exactly how many goes you want.","\"Repeat 3 times: blow out a candle.\" After the third candle, the loop is finished, no matter what.",{"body":1837},{"type":7,"value":1838,"toc":1839},[],{"title":662,"searchDepth":663,"depth":663,"links":1840},[],"glossary\u002Frepeat-loop","Repeat loop","YC2iTUQ841lfmltd6Pkq89uuQbk29RWgR-rWs7MvjJ4",{"id":1845,"category":1553,"definition":1846,"example":1847,"extension":667,"meta":1848,"stem":1853,"term":1854,"__hash__":1855},"glossary\u002Fglossary\u002Frgb-led.md","An RGB LED is a tiny light that can glow in any colour you like. It mixes red, green and blue light in different amounts, a bit like mixing paints, to make all sorts of colours.","Like the colour-changing lights some people put behind their TV, an RGB LED can shift from red to green to blue and everything in between.",{"body":1849},{"type":7,"value":1850,"toc":1851},[],{"title":662,"searchDepth":663,"depth":663,"links":1852},[],"glossary\u002Frgb-led","RGB LED","mIu-76nYeQtI-NsTMcvPueLH11JE0fC5X2jJxBmKwPU",{"id":1857,"category":1553,"definition":1858,"example":1859,"extension":667,"meta":1860,"stem":1865,"term":1866,"__hash__":1867},"glossary\u002Fglossary\u002Fservo-motor.md","A servo motor is a special motor that turns to an exact position you tell it, like 0 or 90 degrees, instead of just spinning round and round.","Like the hand on a clock moving to point at a number, a servo turns to the exact angle you ask for.",{"body":1861},{"type":7,"value":1862,"toc":1863},[],{"title":662,"searchDepth":663,"depth":663,"links":1864},[],"glossary\u002Fservo-motor","Servo motor","IFtMLIEoNZ746ebquvkvp-PAqDQObQACMiWUTb3rfZ8",{"id":1869,"category":1553,"definition":1870,"example":1871,"extension":667,"meta":1872,"stem":1877,"term":1878,"__hash__":1879},"glossary\u002Fglossary\u002Ftemperature-sensor.md","A temperature sensor is a little part that measures how warm or cold it is around it, then turns that into a number your code can read. As the room heats up or cools down, the number changes too.","Like the thermometer that tells you if you've got a temperature when you're poorly, a temperature sensor measures the warmth around it and gives your code a number to work with.",{"body":1873},{"type":7,"value":1874,"toc":1875},[],{"title":662,"searchDepth":663,"depth":663,"links":1876},[],"glossary\u002Ftemperature-sensor","Temperature sensor","UbSScS-TCPLSFDjnxsaFltpoKbORTAOaxh68b_-FMw8",{"id":1881,"category":1590,"definition":1882,"example":1883,"extension":667,"meta":1884,"stem":1889,"term":1890,"__hash__":1891},"glossary\u002Fglossary\u002Fthreshold.md","A threshold is a cut-off number you pick to help your code make a decision. The code checks whether a value is above or below it, then acts. It's like drawing a line and asking \"are we over it or under it?\"","Like setting a bedtime of 8 o'clock: before 8 you're still up, after 8 it's lights out. The time is your threshold.",{"body":1885},{"type":7,"value":1886,"toc":1887},[],{"title":662,"searchDepth":663,"depth":663,"links":1888},[],"glossary\u002Fthreshold","Threshold","xikcgh-PcWY0Z_HhDY16B8SLJLbL0oJD8WUU3KpHqvY",{"id":1893,"category":1678,"definition":1894,"example":1895,"extension":667,"meta":1896,"stem":1901,"term":1902,"__hash__":1903},"glossary\u002Fglossary\u002Fvariable.md","A variable is something that can change. Think of it like a labelled box: you pop something inside, and the label tells you what it is. You can swap what's inside whenever you like.","A variable called score might start at 0, then change to 1, 2 and 3 as you collect points in a game.",{"body":1897},{"type":7,"value":1898,"toc":1899},[],{"title":662,"searchDepth":663,"depth":663,"links":1900},[],"glossary\u002Fvariable","Variable","nlzJUTSGqyIAKSbopFF01oPBuJT59zOT7MSoCpOMp1E",{"id":1905,"category":1603,"definition":1906,"example":1907,"extension":667,"meta":1908,"stem":1913,"term":1914,"__hash__":1915},"glossary\u002Fglossary\u002Fwhile-loop.md","A while loop keeps repeating its instructions for as long as something stays true. The moment that thing stops being true, the loop stops.","\"While it's still raining, keep the umbrella up.\" As soon as the rain stops, you put the umbrella down, and the loop ends.",{"body":1909},{"type":7,"value":1910,"toc":1911},[],{"title":662,"searchDepth":663,"depth":663,"links":1912},[],"glossary\u002Fwhile-loop","While loop","igK-e_snGhkP0kgSn6sPO7YQybQ0WpDfQMB0_8I2iZg",[1917,1923,1929,1935,1941,1947,1953,1959,1965,1971,1977,1983,1989,1995,2001,2007,2013,2019,2025,2031,2037,2043,2049,2055,2061,2067,2073,2079,2085,2091],{"id":1552,"category":1553,"definition":1554,"example":1555,"extension":667,"meta":1918,"stem":1561,"term":1562,"__hash__":1563},{"body":1919},{"type":7,"value":1920,"toc":1921},[],{"title":662,"searchDepth":663,"depth":663,"links":1922},[],{"id":1565,"category":1553,"definition":1566,"example":1567,"extension":667,"meta":1924,"stem":1573,"term":1574,"__hash__":1575},{"body":1925},{"type":7,"value":1926,"toc":1927},[],{"title":662,"searchDepth":663,"depth":663,"links":1928},[],{"id":1577,"category":1553,"definition":1578,"example":1579,"extension":667,"meta":1930,"stem":1585,"term":1586,"__hash__":1587},{"body":1931},{"type":7,"value":1932,"toc":1933},[],{"title":662,"searchDepth":663,"depth":663,"links":1934},[],{"id":1589,"category":1590,"definition":1591,"example":1592,"extension":667,"meta":1936,"stem":1598,"term":1599,"__hash__":1600},{"body":1937},{"type":7,"value":1938,"toc":1939},[],{"title":662,"searchDepth":663,"depth":663,"links":1940},[],{"id":1602,"category":1603,"definition":1604,"example":1605,"extension":667,"meta":1942,"stem":1611,"term":1612,"__hash__":1613},{"body":1943},{"type":7,"value":1944,"toc":1945},[],{"title":662,"searchDepth":663,"depth":663,"links":1946},[],{"id":1615,"category":1616,"definition":1617,"example":1618,"extension":667,"meta":1948,"stem":1624,"term":1625,"__hash__":1626},{"body":1949},{"type":7,"value":1950,"toc":1951},[],{"title":662,"searchDepth":663,"depth":663,"links":1952},[],{"id":1628,"category":1603,"definition":1629,"example":1630,"extension":667,"meta":1954,"stem":1636,"term":1637,"__hash__":1638},{"body":1955},{"type":7,"value":1956,"toc":1957},[],{"title":662,"searchDepth":663,"depth":663,"links":1958},[],{"id":1640,"category":1641,"definition":1642,"example":1643,"extension":667,"meta":1960,"stem":1649,"term":1650,"__hash__":1651},{"body":1961},{"type":7,"value":1962,"toc":1963},[],{"title":662,"searchDepth":663,"depth":663,"links":1964},[],{"id":1653,"category":1590,"definition":1654,"example":1655,"extension":667,"meta":1966,"stem":1661,"term":1662,"__hash__":1663},{"body":1967},{"type":7,"value":1968,"toc":1969},[],{"title":662,"searchDepth":663,"depth":663,"links":1970},[],{"id":1665,"category":1603,"definition":1666,"example":1667,"extension":667,"meta":1972,"stem":1673,"term":1674,"__hash__":1675},{"body":1973},{"type":7,"value":1974,"toc":1975},[],{"title":662,"searchDepth":663,"depth":663,"links":1976},[],{"id":1677,"category":1678,"definition":1679,"example":1680,"extension":667,"meta":1978,"stem":1686,"term":1687,"__hash__":1688},{"body":1979},{"type":7,"value":1980,"toc":1981},[],{"title":662,"searchDepth":663,"depth":663,"links":1982},[],{"id":1690,"category":1553,"definition":1691,"example":1692,"extension":667,"meta":1984,"stem":1698,"term":1699,"__hash__":1700},{"body":1985},{"type":7,"value":1986,"toc":1987},[],{"title":662,"searchDepth":663,"depth":663,"links":1988},[],{"id":1702,"category":1553,"definition":1703,"example":1704,"extension":667,"meta":1990,"stem":1710,"term":1711,"__hash__":1712},{"body":1991},{"type":7,"value":1992,"toc":1993},[],{"title":662,"searchDepth":663,"depth":663,"links":1994},[],{"id":1714,"category":1553,"definition":1715,"example":1716,"extension":667,"meta":1996,"stem":1722,"term":1723,"__hash__":1724},{"body":1997},{"type":7,"value":1998,"toc":1999},[],{"title":662,"searchDepth":663,"depth":663,"links":2000},[],{"id":1737,"category":1641,"definition":1738,"example":1739,"extension":667,"meta":2002,"stem":1745,"term":1746,"__hash__":1747},{"body":2003},{"type":7,"value":2004,"toc":2005},[],{"title":662,"searchDepth":663,"depth":663,"links":2006},[],{"id":1749,"category":1553,"definition":1750,"example":1751,"extension":667,"meta":2008,"stem":1757,"term":1758,"__hash__":1759},{"body":2009},{"type":7,"value":2010,"toc":2011},[],{"title":662,"searchDepth":663,"depth":663,"links":2012},[],{"id":1761,"category":1553,"definition":1762,"example":1763,"extension":667,"meta":2014,"stem":1769,"term":1770,"__hash__":1771},{"body":2015},{"type":7,"value":2016,"toc":2017},[],{"title":662,"searchDepth":663,"depth":663,"links":2018},[],{"id":1773,"category":1553,"definition":1774,"example":1775,"extension":667,"meta":2020,"stem":1781,"term":1782,"__hash__":1783},{"body":2021},{"type":7,"value":2022,"toc":2023},[],{"title":662,"searchDepth":663,"depth":663,"links":2024},[],{"id":1785,"category":1553,"definition":1786,"example":1787,"extension":667,"meta":2026,"stem":1793,"term":1794,"__hash__":1795},{"body":2027},{"type":7,"value":2028,"toc":2029},[],{"title":662,"searchDepth":663,"depth":663,"links":2030},[],{"id":1797,"category":1553,"definition":1798,"example":1799,"extension":667,"meta":2032,"stem":1805,"term":1806,"__hash__":1807},{"body":2033},{"type":7,"value":2034,"toc":2035},[],{"title":662,"searchDepth":663,"depth":663,"links":2036},[],{"id":1845,"category":1553,"definition":1846,"example":1847,"extension":667,"meta":2038,"stem":1853,"term":1854,"__hash__":1855},{"body":2039},{"type":7,"value":2040,"toc":2041},[],{"title":662,"searchDepth":663,"depth":663,"links":2042},[],{"id":1809,"category":1603,"definition":1810,"example":1811,"extension":667,"meta":2044,"stem":1817,"term":1818,"__hash__":1819},{"body":2045},{"type":7,"value":2046,"toc":2047},[],{"title":662,"searchDepth":663,"depth":663,"links":2048},[],{"id":1821,"category":1553,"definition":1822,"example":1823,"extension":667,"meta":2050,"stem":1829,"term":1830,"__hash__":1831},{"body":2051},{"type":7,"value":2052,"toc":2053},[],{"title":662,"searchDepth":663,"depth":663,"links":2054},[],{"id":1833,"category":1603,"definition":1834,"example":1835,"extension":667,"meta":2056,"stem":1841,"term":1842,"__hash__":1843},{"body":2057},{"type":7,"value":2058,"toc":2059},[],{"title":662,"searchDepth":663,"depth":663,"links":2060},[],{"id":1857,"category":1553,"definition":1858,"example":1859,"extension":667,"meta":2062,"stem":1865,"term":1866,"__hash__":1867},{"body":2063},{"type":7,"value":2064,"toc":2065},[],{"title":662,"searchDepth":663,"depth":663,"links":2066},[],{"id":1869,"category":1553,"definition":1870,"example":1871,"extension":667,"meta":2068,"stem":1877,"term":1878,"__hash__":1879},{"body":2069},{"type":7,"value":2070,"toc":2071},[],{"title":662,"searchDepth":663,"depth":663,"links":2072},[],{"id":1881,"category":1590,"definition":1882,"example":1883,"extension":667,"meta":2074,"stem":1889,"term":1890,"__hash__":1891},{"body":2075},{"type":7,"value":2076,"toc":2077},[],{"title":662,"searchDepth":663,"depth":663,"links":2078},[],{"id":1893,"category":1678,"definition":1894,"example":1895,"extension":667,"meta":2080,"stem":1901,"term":1902,"__hash__":1903},{"body":2081},{"type":7,"value":2082,"toc":2083},[],{"title":662,"searchDepth":663,"depth":663,"links":2084},[],{"id":1905,"category":1603,"definition":1906,"example":1907,"extension":667,"meta":2086,"stem":1913,"term":1914,"__hash__":1915},{"body":2087},{"type":7,"value":2088,"toc":2089},[],{"title":662,"searchDepth":663,"depth":663,"links":2090},[],{"id":1726,"category":1553,"definition":1727,"example":1728,"extension":667,"meta":2092,"stem":1734,"term":24,"__hash__":1735},{"body":2093},{"type":7,"value":2094,"toc":2095},[],{"title":662,"searchDepth":663,"depth":663,"links":2096},[],1788101567892]