1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789 |
- 'use strict';
- goog.provide('Blockly.Blocks.microbit');
- goog.require('Blockly.Blocks');
- goog.require('Blockly.constants');
- //Blockly.FieldColour.COLOURS = "#f00 #e00 #d00 #c00 #b00 #a00 #800 #600 #400 #000".split(" ");
- //Blockly.FieldColour.COLUMNS = 5;
- Blockly.Blocks.botbit_rec_from_microbit = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_update_msg_args = {
- init: function () {
- this.jsonInit({
- inputsInline: !1,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_MESSAGE0,
- args0: [{
- type: "input_value",
- name: "msg"
- }, {
- type: "input_dummy"
- }, {
- check: "Number",
- type: "input_value",
- name: "x"
- }, {
- check: "Number",
- type: "input_value",
- name: "y"
- }, {
- check: "Number",
- type: "input_value",
- name: "z"
- }, {
- check: "Boolean",
- type: "input_value",
- name: "L"
- }, {
- check: "Boolean",
- type: "input_value",
- name: "R"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_get_x = {
- init: function () {
- this.jsonInit({
- colour: 0,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_get_y = {
- init: function () {
- this.jsonInit({
- colour: 0,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_get_z = {
- init: function () {
- this.jsonInit({
- colour: 0,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_was_gesture = {
- init: function () {
- this.jsonInit({
- colour: 0,
- args0: [{
- name: "gesture",
- options: [[Blockly.Msg.MICROBIT_GESTURE_SHAKE, "shake"], [Blockly.Msg.MICROBIT_GESTURE_UP, "up"], [Blockly.Msg.MICROBIT_GESTURE_DOWN, "down"], [Blockly.Msg.MICROBIT_GESTURE_LEFT, "left"], [Blockly.Msg.MICROBIT_GESTURE_RIGHT, "right"], [Blockly.Msg.MICROBIT_GESTURE_FACE_UP, "face up"], [Blockly.Msg.MICROBIT_GESTURE_FACE_DOWN, "face down"], [Blockly.Msg.MICROBIT_GESTURE_FREEFAIL, "freefall"], ["3g", "3g"], ["6g", "6g"], ["8g", "8g"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_is_gesture = {
- init: function () {
- this.jsonInit({
- colour: 0,
- args0: [{
- name: "gesture",
- options: [[Blockly.Msg.MICROBIT_GESTURE_SHAKE, "shake"], [Blockly.Msg.MICROBIT_GESTURE_UP, "up"], [Blockly.Msg.MICROBIT_GESTURE_DOWN, "down"], [Blockly.Msg.MICROBIT_GESTURE_LEFT, "left"], [Blockly.Msg.MICROBIT_GESTURE_RIGHT, "right"], [Blockly.Msg.MICROBIT_GESTURE_FACE_UP, "face up"], [Blockly.Msg.MICROBIT_GESTURE_FACE_DOWN, "face down"], [Blockly.Msg.MICROBIT_GESTURE_FREEFAIL, "freefall"], ["3g", "3g"], ["6g", "6g"], ["8g", "8g"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_get_gestures = {
- init: function () {
- this.jsonInit({
- colour: 0,
- output: "Array",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_accelerometer_current_gesture = {
- init: function () {
- this.jsonInit({
- colour: 0,
- output: "String",
- helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_button_is_pressed = {
- init: function () {
- this.jsonInit({
- colour: 32,
- args0: [{
- name: "button",
- options: [["A", "a"], ["B", "b"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_button_was_pressed = {
- init: function () {
- this.jsonInit({
- colour: 32,
- args0: [{
- name: "button",
- options: [["A", "a"], ["B", "b"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_button_get_presses = {
- init: function () {
- this.jsonInit({
- colour: 32,
- args0: [{
- name: "button",
- options: [["A", "a"], ["B", "b"]],
- type: "field_dropdown"
- }],
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_calibrate = {
- init: function () {
- this.jsonInit({
- colour: 64,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_is_calibrated = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_heading = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_HEADING_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_HEADING_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_HEADING_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_get_field_strength = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_x = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_X_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_X_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_X_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_y = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_Y_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_Y_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_Y_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_compass_z = {
- init: function () {
- this.jsonInit({
- colour: 64,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_COMPASS_Z_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_COMPASS_Z_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_COMPASS_Z_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_display_get_pixel = {
- init: function () {
- this.jsonInit({
- args0: [{
- check: "Number",
- type: "input_value",
- name: "x"
- }, {
- check: "Number",
- type: "input_value",
- name: "y"
- }],
- inputsInline: !0,
- output: "Number",
- colour: 96,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_display_set_pixel = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 96,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "x"
- }, {
- check: "Number",
- type: "input_value",
- name: "y"
- }, {
- check: "Number",
- type: "input_value",
- name: "value"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_clear = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_display_show_image = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_MESSAGE0,
- args0: [{
- check: ["microbit_image", "String"],
- type: "input_value",
- name: "image"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_show_image_with_bri = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_WITH_BRI_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_WITH_BRI_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "bri1"
- }, {
- check: "Number",
- type: "input_value",
- name: "bri2"
- }, {
- check: ["microbit_image", "String"],
- type: "input_value",
- name: "image"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_show_animation = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_MESSAGE0,
- args0: [{
- check: ["Array", "String"],
- type: "input_value",
- name: "images"
- }, {
- min: 0,
- value: 400,
- type: "field_number",
- name: "delay"
- }, {
- type: "input_dummy"
- }, {
- checked: !0,
- type: "field_checkbox",
- name: "wait"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "loop"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "clear"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_scroll = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "message"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_scroll_animation = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "message"
- }, {
- min: 0,
- value: 150,
- type: "field_number",
- name: "delay"
- }, {
- type: "input_dummy"
- }, {
- checked: !0,
- type: "field_checkbox",
- name: "wait"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "loop"
- }, {
- type: "input_dummy"
- }, {
- checked: !0,
- type: "field_checkbox",
- name: "monospace"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_display_on = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_ON_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_ON_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_ON_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_display_off = {
- init: function () {
- this.jsonInit({
- colour: 96,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_OFF_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_OFF_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_OFF_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_display_is_on = {
- init: function () {
- this.jsonInit({
- colour: 96,
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_builtins = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- name: "image",
- options: [[Blockly.Msg.MICROBIT_IMAGE_HEART, "HEART"], [Blockly.Msg.MICROBIT_IMAGE_HEART_SMALL, "HEART_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_HAPPY, "HAPPY"], [Blockly.Msg.MICROBIT_IMAGE_SMILE, "SMILE"], [Blockly.Msg.MICROBIT_IMAGE_SAD, "SAD"], [Blockly.Msg.MICROBIT_IMAGE_CONFUSED, "CONFUSED"], [Blockly.Msg.MICROBIT_IMAGE_ANGRY, "ANGRY"], [Blockly.Msg.MICROBIT_IMAGE_ASLEEP, "ASLEEP"], [Blockly.Msg.MICROBIT_IMAGE_SUPRISED, "SURPRISED"], [Blockly.Msg.MICROBIT_IMAGE_SILLY, "SILLY"], [Blockly.Msg.MICROBIT_IMAGE_FABULOUS, "FABULOUS"], [Blockly.Msg.MICROBIT_IMAGE_MEH, "MEH"], [Blockly.Msg.MICROBIT_IMAGE_YES, "YES"], [Blockly.Msg.MICROBIT_IMAGE_NO, "NO"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK12, "CLOCK12"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK11, "CLOCK11"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK10, "CLOCK10"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK9, "CLOCK9"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK8, "CLOCK8"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK7, "CLOCK7"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK6, "CLOCK6"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK5, "CLOCK5"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK4, "CLOCK4"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK3, "CLOCK3"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK2, "CLOCK2"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK1, "CLOCK1"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_N, "ARROW_N"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_NE, "ARROW_NE"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_E, "ARROW_E"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_SE, "ARROW_SE"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_S, "ARROW_S"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_SW, "ARROW_SW"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_W, "ARROW_W"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_NW, "ARROW_NW"], [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE, "TRIANGLE"], [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE_LEFT, "TRIANGLE_LEFT"], [Blockly.Msg.MICROBIT_IMAGE_CHESSBOARD, "CHESSBOARD"], [Blockly.Msg.MICROBIT_IMAGE_DIAMOND, "DIAMOND"], [Blockly.Msg.MICROBIT_IMAGE_DIAMOND_SMALL, "DIAMOND_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_SQUARE, "SQUARE"], [Blockly.Msg.MICROBIT_IMAGE_SQUARE_SMALL, "SQUARE_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_RABBIT, "RABBIT"], [Blockly.Msg.MICROBIT_IMAGE_COW, "COW"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_CROTCHET, "MUSIC_CROTCHET"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVER, "MUSIC_QUAVER"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVERS, "MUSIC_QUAVERS"], [Blockly.Msg.MICROBIT_IMAGE_PITCHFORK, "PITCHFORK"], [Blockly.Msg.MICROBIT_IMAGE_XMAS, "XMAS"], [Blockly.Msg.MICROBIT_IMAGE_PACMAN, "PACMAN"], [Blockly.Msg.MICROBIT_IMAGE_TARGET, "TARGET"], [Blockly.Msg.MICROBIT_IMAGE_TSHIRT, "TSHIRT"], [Blockly.Msg.MICROBIT_IMAGE_ROLLERSKATE, "ROLLERSKATE"], [Blockly.Msg.MICROBIT_IMAGE_DUCK, "DUCK"], [Blockly.Msg.MICROBIT_IMAGE_HOUSE, "HOUSE"], [Blockly.Msg.MICROBIT_IMAGE_TORTOISE, "TORTOISE"], [Blockly.Msg.MICROBIT_IMAGE_BUTTERFLY, "BUTTERFLY"], [Blockly.Msg.MICROBIT_IMAGE_STICKFIGURE, "STICKFIGURE"], [Blockly.Msg.MICROBIT_IMAGE_GHOST, "GHOST"], [Blockly.Msg.MICROBIT_IMAGE_SWORD, "SWORD"], [Blockly.Msg.MICROBIT_IMAGE_GIRAFFE, "GIRAFFE"], [Blockly.Msg.MICROBIT_IMAGE_SKULL, "SKULL"], [Blockly.Msg.MICROBIT_IMAGE_UMBRELLA, "UMBRELLA"], [Blockly.Msg.MICROBIT_IMAGE_SNAKE, "SNAKE"], [Blockly.Msg.MICROBIT_IMAGE_ALL_CLOCKS, "ALL_CLOCKS"], [Blockly.Msg.MICROBIT_IMAGE_ALL_ARROWS, "ALL_ARROWS"]],
- type: "field_dropdown"
- }],
- output: ["microbit_image", "Array"],
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_copy = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- check: "microbit_image",
- type: "input_value",
- name: "image"
- }],
- output: "microbit_image",
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_COPY_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_COPY_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_COPY_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_invert = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- check: "microbit_image",
- type: "input_value",
- name: "image"
- }],
- output: "microbit_image",
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_INVERT_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_INVERT_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_INVERT_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_create = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- type: "input_dummy"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "00"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "01"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "02"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "03"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "04"
- }, {
- type: "input_dummy"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "10"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "11"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "12"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "13"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "14"
- }, {
- type: "input_dummy"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "20"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "21"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "22"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "23"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "24"
- }, {
- type: "input_dummy"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "30"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "31"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "32"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "33"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "34"
- }, {
- type: "input_dummy"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "40"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "41"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "42"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "43"
- }, {
- colour: "#000000",
- type: "field_colour",
- name: "44"
- }],
- output: "microbit_image",
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_CREATE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_CREATE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_CREATE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_create1 = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- type: "input_dummy"
- }, {
- name: "row0",
- type: "input_value",
- check: "String"
- }, {
- name: "row1",
- type: "input_value",
- check: "String"
- }, {
- name: "row2",
- type: "input_value",
- check: "String"
- }, {
- name: "row3",
- type: "input_value",
- check: "String"
- }, {
- name: "row4",
- type: "input_value",
- check: "String"
- }],
- output: "microbit_image",
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_CREATE1_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_CREATE1_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_CREATE1_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_image_shift = {
- init: function () {
- this.jsonInit({
- colour: 128,
- args0: [{
- check: "microbit_image",
- type: "input_value",
- name: "image"
- }, {
- name: "shift",
- options: [[Blockly.Msg.MICROBIT_IMAGE_SHIFT_LEFT, "LEFT"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_RIGHT, "RIGHT"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_UP, "UP"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_DOWN, "DOWN"]],
- type: "field_dropdown"
- }, {
- check: "Number",
- type: "input_value",
- name: "pos"
- }],
- output: "microbit_image",
- helpUrl: Blockly.Msg.MICROBIT_IMAGE_SHIFT_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_IMAGE_SHIFT_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_IMAGE_SHIFT_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_microbit_panic = {
- init: function () {
- this.jsonInit({
- colour: 160,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MICROBIT_PANIC_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MICROBIT_PANIC_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MICROBIT_PANIC_MESSAGE0,
- args0: [{
- min: 0,
- value: 0,
- type: "field_number",
- max: 255,
- name: "code"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_microbit_reset = {
- init: function () {
- this.jsonInit({
- colour: 160,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MICROBIT_RESET_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MICROBIT_RESET_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MICROBIT_RESET_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_microbit_sleep = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 160,
- helpUrl: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "duration"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_microbit_running_time = {
- init: function () {
- this.jsonInit({
- colour: 160,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_microbit_temperature = {
- init: function () {
- this.jsonInit({
- colour: 160,
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_music_play_built_in = {
- init: function () {
- this.jsonInit({
- colour: 192,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_MESSAGE0,
- args0: [{
- name: "melody",
- options: [["DADADADUM", "DADADADUM"], ["ENTERTAINER", "ENTERTAINER"], ["PRELUDE", "PRELUDE"], ["ODE", "ODE"], ["NYAN", "NYAN"], ["RINGTONE", "RINGTONE"], ["FUNK", "FUNK"], ["BLUES", "BLUES"], ["BIRTHDAY", "BIRTHDAY"], ["WEDDING", "WEDDING"], ["FUNERAL", "FUNERAL"], ["PUNCHLINE", "PUNCHLINE"], ["PYTHON", "PYTHON"], ["BADDY", "BADDY"], ["CHASE", "CHASE"], ["BA_DING", "BA_DING"], ["WAWAWAWAA", "WAWAWAWAA"], ["JUMP_UP", "JUMP_UP"], ["JUMP_DOWN", "JUMP_DOWN"], ["POWER_UP", "POWER_UP"], ["POWER_DOWN", "POWER_DOWN"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- checked: !0,
- type: "field_checkbox",
- name: "wait"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "loop"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_music_pitch = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 192,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_PITCH_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_PITCH_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_PITCH_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "pitch"
- }, {
- type: "input_dummy"
- }, {
- check: "Number",
- type: "input_value",
- name: "duration"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_music_play_list_of_notes = {
- init: function () {
- this.jsonInit({
- colour: 192,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_MESSAGE0,
- args0: [{
- check: "Array",
- type: "input_value",
- name: "notes"
- }, {
- checked: !0,
- type: "field_checkbox",
- name: "wait"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "loop"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_music_reset = {
- init: function () {
- this.jsonInit({
- colour: 192,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_RESET_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_RESET_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_RESET_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_music_stop = {
- init: function () {
- this.jsonInit({
- colour: 192,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_STOP_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_STOP_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_STOP_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_music_set_tempo = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 192,
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "ticks"
- }, {
- check: "Number",
- type: "input_value",
- name: "bpm"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_music_get_tempo = {
- init: function () {
- this.jsonInit({
- colour: 192,
- output: "Array",
- helpUrl: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_neopixel_initialise = {
- init: function () {
- this.jsonInit({
- colour: 224,
- args0: [{
- name: "pin",
- options: [["pin0", "pin0"], ["pin1", "pin1"], ["pin2", "pin2"], ["pin3", "pin3"], ["pin4", "pin4"], ["pin5", "pin5"], ["pin6", "pin6"], ["pin7", "pin7"], ["pin8", "pin8"], ["pin9", "pin9"], ["pin10", "pin10"], ["pin11", "pin11"], ["pin12", "pin12"], ["pin13", "pin13"], ["pin14", "pin14"], ["pin15", "pin15"], ["pin16", "pin16"], ["pin17", "pin17"], ["pin18", "pin18"], ["pin19", "pin19"], ["pin20", "pin20"]],
- type: "field_dropdown"
- }, {
- min: 1,
- value: 1,
- type: "field_number",
- name: "n"
- }],
- output: "neopixel_object",
- helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_neopixel_clear = {
- init: function () {
- this.jsonInit({
- colour: 224,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_MESSAGE0,
- args0: [{
- check: "neopixel_object",
- type: "input_value",
- name: "neopixel_object"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_neopixel_show = {
- init: function () {
- this.jsonInit({
- colour: 224,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_MESSAGE0,
- args0: [{
- check: "neopixel_object",
- type: "input_value",
- name: "neopixel_object"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_neopixel_set = {
- init: function () {
- this.jsonInit({
- inputsInline: !1,
- nextStatement: null,
- previousStatement: null,
- colour: 224,
- helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_SET_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_SET_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_NEOPIXEL_SET_MESSAGE0,
- args0: [{
- check: "neopixel_object",
- type: "input_value",
- name: "neopixel_object"
- }, {
- check: "Number",
- type: "input_value",
- name: "pixel"
- }, {
- check: "Number",
- type: "input_value",
- name: "red"
- }, {
- check: "Number",
- type: "input_value",
- name: "green"
- }, {
- check: "Number",
- type: "input_value",
- name: "blue"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_pin_touched = {
- init: function () {
- this.jsonInit({
- colour: 256,
- args0: [{
- name: "pin",
- options: [["0", "0"], ["1", "1"], ["2", "2"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_PIN_TOUCHED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_TOUCHED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_TOUCHED_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_pin_was_pressed = {
- init: function () {
- this.jsonInit({
- colour: 256,
- args0: [{
- name: "pin",
- options: [["0", "0"], ["1", "1"], ["2", "2"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_pin_get_presses = {
- init: function () {
- this.jsonInit({
- colour: 256,
- args0: [{
- name: "pin",
- options: [["0", "0"], ["1", "1"], ["2", "2"]],
- type: "field_dropdown"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_pin_read_analog = {
- init: function () {
- this.jsonInit({
- colour: 256,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- helpUrl: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_pin_write_analog = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- colour: 256,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "output"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_pin_read_digital = {
- init: function () {
- this.jsonInit({
- colour: 256,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- helpUrl: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_pin_write_digital = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- colour: 256,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "output"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_pin_set_servo = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- colour: 256,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }, {
- name: "degree",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.MICROBIT_PIN_SET_SERVO_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_SET_SERVO_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_SET_SERVO_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.microbit_pin_set_mode = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- colour: 256,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }, {
- name: "mode",
- options: [[Blockly.Msg.MICROBIT_PIN_MODE_NO, "NO"], [Blockly.Msg.MICROBIT_PIN_MODE_UP, "UP"], [Blockly.Msg.MICROBIT_PIN_MODE_DOWN, "DOWN"]],
- type: "field_dropdown"
- }],
- helpUrl: Blockly.Msg.MICROBIT_PIN_SET_MODE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_PIN_SET_MODE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_PIN_SET_MODE_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.microbit_radio_on = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_ON_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_ON_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_ON_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_radio_off = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_OFF_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_OFF_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_OFF_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_radio_config = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_CONFIG_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_CONFIG_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_CONFIG_MESSAGE0,
- args0: [{
- min: 4,
- value: 32,
- type: "field_number",
- max: 251,
- name: "length"
- }, {
- type: "input_dummy"
- }, {
- min: 1,
- value: 3,
- type: "field_number",
- max: 32,
- name: "queue"
- }, {
- type: "input_dummy"
- }, {
- min: 0,
- value: 7,
- type: "field_number",
- max: 100,
- name: "channel"
- }, {
- type: "input_dummy"
- }, {
- min: 0,
- value: 0,
- type: "field_number",
- max: 7,
- name: "power"
- }, {
- type: "input_dummy"
- }, {
- text: "0x75626974",
- type: "field_input",
- name: "address"
- }, {
- type: "input_dummy"
- }, {
- min: 0,
- value: 0,
- type: "field_number",
- max: 255,
- name: "group"
- }, {
- type: "input_dummy"
- }, {
- name: "data_rate",
- options: [["1Mbit", "RATE_1MBIT"], ["250Kbit", "RATE_250KBIT"], ["2Mbit", "RATE_2MBIT"]],
- type: "field_dropdown"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_radio_reset = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_RESET_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_RESET_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_RESET_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_radio_send_string = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "message"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_radio_send_bytes = {
- init: function () {
- this.jsonInit({
- colour: 288,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_MESSAGE0,
- args0: [{
- check: "Array",
- type: "input_value",
- name: "message"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_radio_receive = {
- init: function () {
- this.jsonInit({
- colour: 288,
- output: "String",
- helpUrl: Blockly.Msg.MICROBIT_RADIO_RECEIVE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_RECEIVE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_RECEIVE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_radio_receive_bytes = {
- init: function () {
- this.jsonInit({
- colour: 288,
- output: "Array",
- helpUrl: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_speech_say = {
- init: function () {
- this.jsonInit({
- colour: 320,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_SPEECH_SAY_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_SPEECH_SAY_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_SPEECH_SAY_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "english"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_speech_pronounce = {
- init: function () {
- this.jsonInit({
- colour: 320,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "phonemes"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_speech_sing = {
- init: function () {
- this.jsonInit({
- colour: 320,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_SPEECH_SING_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_SPEECH_SING_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_SPEECH_SING_MESSAGE0,
- args0: [{
- check: "String",
- type: "input_value",
- name: "song"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_set_music_pin = {
- init: function () {
- this.jsonInit({
- colour: 192,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_MESSAGE0,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_init_i2c = {
- init: function () {
- this.jsonInit({
- colour: 160,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_INIT_I2C_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_INIT_I2C_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_INIT_I2C_MESSAGE0,
- args0: [{
- name: "fqs",
- type: "input_value",
- check: "Number"
- }, {
- name: "sda",
- type: "input_value",
- check: "Number"
- }, {
- name: "scl",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_i2c_read = {
- init: function () {
- this.jsonInit({
- colour: 160,
- output: "Array",
- helpUrl: Blockly.Msg.MICROBIT_I2C_READ_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_I2C_READ_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_I2C_READ_MESSAGE0,
- args0: [{
- name: "addr",
- type: "input_value",
- check: "Number"
- }, {
- name: "bytes",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_i2c_write = {
- init: function () {
- this.jsonInit({
- colour: 160,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_I2C_WRITE_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_I2C_WRITE_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_I2C_WRITE_MESSAGE0,
- args0: [{
- name: "addr",
- type: "input_value",
- check: "Number"
- }, {
- name: "buf",
- type: "input_value",
- check: "Array"
- }]
- })
- }
- };
- Blockly.Blocks.microbit_convert_bytearray = {
- init: function () {
- this.jsonInit({
- colour: 160,
- output: "Array",
- helpUrl: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_MESSAGE0,
- args0: [{
- name: "arr",
- type: "input_value",
- check: null
- }]
- })
- }
- };
- Blockly.Blocks.microbit_uart_init = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- name: "tx",
- check: "Number",
- type: "input_value"
- }, {
- name: "rx",
- check: "Number",
- type: "input_value"
- }, {
- name: "baudrate",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_UART_INIT_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UART_INIT_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UART_INIT_MESSAGE0
- })
- }
- };
- Blockly.Blocks.microbit_uart_any_msg_received = {
- init: function () {
- this.jsonInit({
- colour: 160,
- helpUrl: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_MESSAGE0,
- output: "Boolean"
- })
- }
- };
- Blockly.Blocks.microbit_uart_msg_type = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- name: "type0",
- options: [[Blockly.Msg.MICROBIT_ALL_BYTES, "readall"], [Blockly.Msg.MICROBIT_ALINE_BYTES, "readline"], ["1", "1"], ["2", "2"], ["4", "4"]],
- type: "field_dropdown"
- }],
- helpUrl: "",
- tooltip: "",
- message0: "%1",
- output: ["Number", "String"]
- })
- }
- };
- Blockly.Blocks.microbit_uart_msg_type1 = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- name: "type0",
- options: [[Blockly.Msg.MICROBIT_ALL_BYTES, "readall"], ["1", "1"], ["2", "2"], ["4", "4"]],
- type: "field_dropdown"
- }],
- helpUrl: "",
- tooltip: "",
- message0: "%1",
- output: ["Number", "String"]
- })
- }
- };
- Blockly.Blocks.microbit_uart_read_msg = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- name: "type0",
- type: "input_value"
- }],
- helpUrl: Blockly.Msg.MICROBIT_UART_READ_MSG_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UART_READ_MSG_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UART_READ_MSG_MESSAGE0,
- output: ["Number", "String"]
- })
- }
- };
- Blockly.Blocks.microbit_uart_read_msg_to = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- name: "type0",
- type: "input_value"
- }, {
- name: "buf0",
- type: "input_value"
- }],
- helpUrl: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_MESSAGE0,
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.microbit_uart_write_msg = {
- init: function () {
- this.jsonInit({
- colour: 160,
- args0: [{
- type: "input_value",
- name: "msg0",
- check: ["Array", "String"]
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.MICROBIT_UART_WRITE_MSG_HELPURL,
- tooltip: Blockly.Msg.MICROBIT_UART_WRITE_MSG_TOOLTIP,
- message0: Blockly.Msg.MICROBIT_UART_WRITE_MSG_MESSAGE0
- })
- }
- };
- Blockly.Blocks.CocoRobo_custom_code = {
- init: function () {
- this.jsonInit({
- inputsInline: !1,
- nextStatement: null,
- previousStatement: null,
- colour: CategoryColors.Text,
- helpUrl: Blockly.Msg.CocoRobo_CUSTOM_CODE_HELPURL,
- tooltip: Blockly.Msg.CocoRobo_CUSTOM_CODE_TOOLTIP,
- message0: Blockly.Msg.CocoRobo_CUSTOM_CODE_MESSAGE0,
- args0: [{
- name: "custom_type",
- options: [[Blockly.Msg.CocoRobo_CUSTOM_TYPE_NORMAL, "normal"], [Blockly.Msg.CocoRobo_CUSTOM_TYPE_IMPORT, "topping"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- type: "field_textarea",
- name: "custom_code",
- text: "custom code"
- }]
- })
- }
- };
- Blockly.Blocks.CocoRobo_print_to_chart = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.itemCount_ = 1;
- this.updateShape_();
- this.setNextStatement(!0);
- this.setPreviousStatement(!0);
- this.setMutator(new Blockly.Mutator(["CocoRobo_print_to_chart_item"]));
- this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_TOOLTIP)
- },
- mutationToDom: function () {
- var a = document.createElement("mutation");
- a.setAttribute("items", this.itemCount_);
- return a
- },
- domToMutation: function (a) {
- this.itemCount_ = parseInt(a.getAttribute("items"), 10);
- this.updateShape_()
- },
- decompose: function (a) {
- var b = a.newBlock("CocoRobo_print_to_chart_container");
- b.initSvg();
- for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
- var d = a.newBlock("CocoRobo_print_to_chart_item");
- d.initSvg();
- c.connect(d.previousConnection);
- c = d.nextConnection
- }
- return b
- },
- compose: function (a) {
- var b = a.getInputTargetBlock("STACK");
- for (a = []; b;)
- a.push(b.valueConnection_),
- b = b.nextConnection && b.nextConnection.targetBlock();
- for (b = 0; b < this.itemCount_; b++) {
- var c = this.getInput("ADD" + b).connection.targetConnection;
- c && -1 == a.indexOf(c) && c.disconnect()
- }
- this.itemCount_ = a.length;
- 4 < this.itemCount_ && (this.itemCount_ = 4);
- this.updateShape_();
- for (b = 0; b < this.itemCount_; b++)
- Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
- },
- saveConnections: function (a) {
- a = a.getInputTargetBlock("STACK");
- for (var b = 0; a;) {
- var c = this.getInput("ADD" + b);
- a.valueConnection_ = c && c.connection.targetConnection;
- b++;
- a = a.nextConnection && a.nextConnection.targetBlock()
- }
- },
- updateShape_: function () {
- this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_EMPTY_TITLE);
- for (var a = 0; a < this.itemCount_; a++)
- if (!this.getInput("ADD" + a)) {
- var b = this.appendValueInput("ADD" + a);
- 0 == a && b.setCheck("Number").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_INPUT_WITH)
- }
- for (; this.getInput("ADD" + a);)
- this.removeInput("ADD" + a),
- a++
- }
- };
- Blockly.Blocks.CocoRobo_print_to_chart_item = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TITLE);
- this.setPreviousStatement(!0);
- this.setNextStatement(!0);
- this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TOOLTIP);
- this.contextMenu = !1
- }
- };
- Blockly.Blocks.CocoRobo_print_to_chart_container = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TITLE_ADD);
- this.appendStatementInput("STACK");
- this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TOOLTIP);
- this.contextMenu = !1
- }
- };
- Blockly.Blocks.CocoRobo_init_chart = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.itemCount_ = 1;
- this.updateShape_();
- this.setNextStatement(!0);
- this.setPreviousStatement(!0);
- this.setMutator(new Blockly.Mutator(["CocoRobo_init_chart_item"]));
- this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_TOOLTIP)
- },
- mutationToDom: function () {
- var a = document.createElement("mutation");
- a.setAttribute("items", this.itemCount_);
- return a
- },
- domToMutation: function (a) {
- this.itemCount_ = parseInt(a.getAttribute("items"), 10);
- this.updateShape_()
- },
- decompose: function (a) {
- var b = a.newBlock("CocoRobo_init_chart_container");
- b.initSvg();
- for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
- var d = a.newBlock("CocoRobo_init_chart_item");
- d.initSvg();
- c.connect(d.previousConnection);
- c = d.nextConnection
- }
- return b
- },
- compose: function (a) {
- var b = a.getInputTargetBlock("STACK");
- for (a = []; b;)
- a.push(b.valueConnection_),
- b = b.nextConnection && b.nextConnection.targetBlock();
- for (b = 0; b < this.itemCount_; b++) {
- var c = this.getInput("ADD" + b).connection.targetConnection;
- c && -1 == a.indexOf(c) && c.disconnect()
- }
- this.itemCount_ = a.length;
- 4 < this.itemCount_ && (this.itemCount_ = 4);
- this.updateShape_();
- for (b = 0; b < this.itemCount_; b++)
- Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
- },
- saveConnections: function (a) {
- a = a.getInputTargetBlock("STACK");
- for (var b = 0; a;) {
- var c = this.getInput("ADD" + b);
- a.valueConnection_ = c && c.connection.targetConnection;
- b++;
- a = a.nextConnection && a.nextConnection.targetBlock()
- }
- },
- updateShape_: function () {
- this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_INIT_CHART_EMPTY_TITLE);
- for (var a = 0; a < this.itemCount_; a++)
- if (!this.getInput("ADD" + a)) {
- var b = this.appendValueInput("ADD" + a);
- 0 == a && b.setCheck("String").appendField(Blockly.Msg.CocoRobo_INIT_CHART_INPUT_WITH)
- }
- for (; this.getInput("ADD" + a);)
- this.removeInput("ADD" + a),
- a++
- }
- };
- Blockly.Blocks.CocoRobo_init_chart_item = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TITLE);
- this.setPreviousStatement(!0);
- this.setNextStatement(!0);
- this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TOOLTIP);
- this.contextMenu = !1
- }
- };
- Blockly.Blocks.CocoRobo_init_chart_container = {
- init: function () {
- this.setColour(CategoryColors.Math);
- this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TITLE_ADD);
- this.appendStatementInput("STACK");
- this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TOOLTIP);
- this.contextMenu = !1
- }
- };
- var labplus_gpi = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["10", "10"], ["11", "11"], ["12", "12"], ["13", "13"], ["14", "14"], ["15", "15"], ["16", "16"], ["19", "19"], ["20", "20"]]
- , analogPins = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["10", "10"]]
- , digitalOutput = [["0", "0"], ["1", "1"]]
- , extendedPins = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"]]
- , labplus_pin_pair = [["6 \x26 7", "6 \x26 7"], ["8 \x26 9", "8 \x26 9"], ["0 \x26 1", "0 \x26 1"], ["13 \x26 14", "13 \x26 14"], ["15 \x26 16", "15 \x26 16"]]
- , labplus_color = "#336699"
- , bluebitdigital = "#2E8B57"
- , bluebitanalog = "#00008B"
- , bluebiti2c = "#CDAD00";
- Blockly.Blocks.labplus_digital_output = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "outputSt",
- options: digitalOutput,
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_extended_pins = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "pin",
- options: extendedPins,
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_labplus_gpi = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "pin",
- options: labplus_gpi,
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_analog_pins = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "pin",
- options: analogPins,
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_servo_output = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "num",
- type: "field_number",
- value: 90,
- min: 0,
- max: 180
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_analog_output = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "num",
- type: "field_number",
- value: 1023,
- min: 0,
- max: 1023
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_extended_pin_define = {
- init: function () {
- this.jsonInit({
- colour: 320,
- args0: [{
- name: "pin_define",
- options: [[Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_INPUT, "0"], [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_OUTPUT, "1"]],
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1"
- })
- }
- };
- Blockly.Blocks.labplus_infrared_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_sound_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_human_detector_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_magnetic_switch_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_line_follower_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_shake_detector_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_smoke_detector_is_triggered = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_fingerprint_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_get_rfid_id = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_GET_RFID_ID_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_GET_RFID_ID_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_GET_RFID_ID_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_button_module_is_pressed = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_heat_sensitive_detector = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_4button = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }, {
- name: "button_val",
- type: "field_dropdown",
- options: [[Blockly.Msg.BLUE, "1"], [Blockly.Msg.GREEN, "2"], [Blockly.Msg.RED, "3"], [Blockly.Msg.YELLOW, "4"]]
- }],
- output: "Boolean",
- message0: Blockly.Msg.LABPLUS_4BUTTON_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_4BUTTON_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_4BUTTON_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_temperature_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_rotate_dimmer = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_ROTATE_DIMMER_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_ROTATE_DIMMER_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_ROTATE_DIMMER_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_water_level_detector = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_sound_level_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_smoke_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_SMOKE_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SMOKE_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SMOKE_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_joystick = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }, {
- name: "pin1",
- type: "input_value",
- check: "Number"
- }, {
- name: "axis",
- type: "field_dropdown",
- options: [["X", "X"], ["Y", "Y"]]
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_JOYSTICK_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_JOYSTICK_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_JOYSTICK_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_soil_moisture_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_light_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebitanalog,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_LIGHT_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_LIGHT_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_LIGHT_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_i2c_light_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- output: "Number",
- message0: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_temp_hum_sensor = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "opt",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_TM_HM_SENSOR_TM, "temperature"], [Blockly.Msg.LABPLUS_TM_HM_SENSOR_HM, "humility"]]
- }],
- output: "Number",
- message0: Blockly.Msg.LABPLUS_TM_HM_SENSOR_MESSAGE0,
- tooltip: Blockly.Msg.LABPLUS_TM_HM_SENSOR_TOOLTIP,
- helpUrl: Blockly.Msg.LABPLUS_TM_HM_SENSOR_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_read_color_from_i2c = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [],
- helpUrl: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_rgb_color = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "color",
- options: [["R", "R"], ["G", "G"], ["B", "B"]],
- type: "field_dropdown"
- }],
- helpUrl: Blockly.Msg.LABPLUS_RGB_COLOR_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_RGB_COLOR_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_RGB_COLOR_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.labplus_i2c_ultrasonic = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- helpUrl: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.labplus_led = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "output"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_LED_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_LED_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_LED_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_fan_switch = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_FAN_SWITCH_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_FAN_SWITCH_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_FAN_SWITCH_MESSAGE0,
- args0: [{
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]],
- name: "status"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.labplus_laser_switch = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_LASER_SWITCH_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_LASER_SWITCH_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_LASER_SWITCH_MESSAGE0,
- args0: [{
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]],
- name: "status"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.labplus_usb_switch = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_USB_SWITCH_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_USB_SWITCH_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_USB_SWITCH_MESSAGE0,
- args0: [{
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]],
- name: "status"
- }, {
- name: "pin",
- type: "input_value",
- check: "Number"
- }]
- })
- }
- };
- Blockly.Blocks.labplus_voice_record_on1 = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- type: "field_dropdown",
- name: "func",
- options: [[Blockly.Msg.LABPLUS_VOICE_RECORD_PLAY, "play"], [Blockly.Msg.LABPLUS_VOICE_RECORD_REC, "rec"]]
- }, {
- type: "input_dummy"
- }, {
- type: "input_value",
- name: "rec",
- check: "Number"
- }, {
- type: "input_value",
- name: "play",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_MESSAGE0,
- nextStatement: null,
- previousStatement: null,
- inputsInline: !1
- })
- }
- };
- Blockly.Blocks.labplus_voice_record_off1 = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- type: "input_dummy"
- }, {
- name: "rec",
- type: "input_value",
- check: "Number"
- }, {
- name: "play",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_servo = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- type: "input_value",
- check: "Number"
- }, {
- name: "degree",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_SERVO_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_SERVO_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_SERVO_MESSAGE0,
- nextStatement: null,
- previousStatement: null,
- inputsInline: !1
- })
- }
- };
- Blockly.Blocks.labplus_motor_on1 = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "0"]]
- }, {
- name: "speed",
- type: "input_value",
- check: "Number"
- }, {
- name: "ain1",
- type: "input_value",
- check: "Number"
- }, {
- name: "ain2",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_MOTOR_ON1_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_MOTOR_ON1_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_MOTOR_ON1_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_motor_off1 = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- type: "input_dummy"
- }, {
- name: "ain1",
- type: "input_value",
- check: "Number"
- }, {
- name: "ain2",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_MOTOR_OFF1_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_MOTOR_OFF1_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_MOTOR_OFF1_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_digits = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "val",
- type: "input_value",
- check: ["Number", "Boolean"]
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_turn_off_i2c_digits = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [],
- helpUrl: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_lcd1602_cursor = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "input_dummy"
- }, {
- name: "xaxis",
- type: "input_value",
- check: "Number"
- }, {
- name: "yaxis",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_lcd1602_print = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "msg0",
- type: "input_value",
- check: "String"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_lcd1602_scroll = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "field_dropdown",
- name: "dir",
- options: [[Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_ALEFT, "aleft"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_RIGHTWARD, "rightward"]]
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_lcd1602_clear = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_lcd1602_state = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "field_dropdown",
- name: "action",
- options: [[Blockly.Msg.LABPLUS_SET_I2C_LCD1602_HIDE_CURSOR, "0x0c"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SHOW_CURSOR, "0x0e"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_BLINK_CURSOR, "0x0d"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_LEFT, "0x18"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_RIGHT, "0x1c"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_LEFT_TO_RIGHT, "0x06"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_RIGHT_TO_LEFT, "0x04"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_TO_ORIGIN, "0x02"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR, "0x01"]]
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_led_matrix2 = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "00"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "01"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "02"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "03"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "04"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "05"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "06"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "07"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "10"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "11"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "12"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "13"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "14"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "15"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "16"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "17"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "20"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "21"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "22"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "23"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "24"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "25"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "26"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "27"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "30"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "31"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "32"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "33"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "34"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "35"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "36"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "37"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "40"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "41"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "42"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "43"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "44"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "45"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "46"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "47"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "50"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "51"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "52"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "53"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "54"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "55"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "56"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "57"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "60"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "61"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "62"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "63"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "64"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "65"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "66"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "67"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "70"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "71"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "72"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "73"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "74"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "75"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "76"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "77"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_MESSAGE2,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_led_matrix = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "input_dummy"
- }, {
- type: "input_value",
- name: "row1",
- check: "Number"
- }, {
- type: "input_value",
- name: "row2",
- check: "Number"
- }, {
- type: "input_value",
- name: "row3",
- check: "Number"
- }, {
- type: "input_value",
- name: "row4",
- check: "Number"
- }, {
- type: "input_value",
- name: "row5",
- check: "Number"
- }, {
- type: "input_value",
- name: "row6",
- check: "Number"
- }, {
- type: "input_value",
- name: "row7",
- check: "Number"
- }, {
- type: "input_value",
- name: "row8",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_i2c_led_matrix_side = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "side",
- options: [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"]],
- type: "field_dropdown"
- }],
- helpUrl: "",
- tooltip: "",
- message0: "%1",
- output: "Number"
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_led_matrix_draw_pixel = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "input_dummy"
- }, {
- type: "input_value",
- name: "x",
- check: "Number"
- }, {
- type: "input_value",
- name: "y",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_led_matrix_show = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_set_i2c_led_matrix_clear = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_uart_init_midi = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "pin",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_INIT_MIDI_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_INIT_MIDI_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_INIT_MIDI_MESSAGE0
- })
- }
- };
- var melodic = [[Blockly.Msg.JOINT_MIDI_PIANO, "1"], [Blockly.Msg.JOINT_Vibraphone, "12"], [Blockly.Msg.JOINT_MIDI_ORGAN, "17"], [Blockly.Msg.JOINT_Acoustic_Guitar, "25"], [Blockly.Msg.JOINT_Electric_Guitar, "31"], [Blockly.Msg.JOINT_Acoustic_Bass, "33"], [Blockly.Msg.JOINT_Violin, "41"], [Blockly.Msg.JOINT_String_Ensemble, "49"], [Blockly.Msg.JOINT_Trumpet, "57"], [Blockly.Msg.JOINT_Sax, "65"], [Blockly.Msg.JOINT_MIDI_BRIGHTACOUSTICPIANO, "2"], [Blockly.Msg.JOINT_MIDI_ELECTRICGRANDPIANO, "3"], [Blockly.Msg.JOINT_MIDI_HARPSICHORD, "7"], [Blockly.Msg.JOINT_MIDI_Celesta, "9"], [Blockly.Msg.JOINT_MIDI_Glockenspiel, "10"], [Blockly.Msg.JOINT_MIDI_Marimba, "13"], [Blockly.Msg.JOINT_MIDI_Xylophone, "14"], [Blockly.Msg.JOINT_MIDI_TubularBell, "15"], [Blockly.Msg.JOINT_MIDI_Dulcimer, "16"], [Blockly.Msg.JOINT_Lead, "81"], [Blockly.Msg.JOINT_Pad, "89"], [Blockly.Msg.JOINT_Steel_Drums, "115"]];
- Blockly.Blocks.labplus_uart_set_midi_melodic = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "melodic",
- options: [[Blockly.Msg.JOINT_MIDI_PIANO, "1"], [Blockly.Msg.JOINT_Vibraphone, "12"], [Blockly.Msg.JOINT_MIDI_ORGAN, "17"], [Blockly.Msg.JOINT_Acoustic_Guitar, "25"], [Blockly.Msg.JOINT_Electric_Guitar, "31"], [Blockly.Msg.JOINT_Acoustic_Bass, "33"], [Blockly.Msg.JOINT_Violin, "41"], [Blockly.Msg.JOINT_String_Ensemble, "49"], [Blockly.Msg.JOINT_Trumpet, "57"], [Blockly.Msg.JOINT_Sax, "65"], [Blockly.Msg.JOINT_MIDI_BRIGHTACOUSTICPIANO, "2"], [Blockly.Msg.JOINT_MIDI_ELECTRICGRANDPIANO, "3"], [Blockly.Msg.JOINT_MIDI_HARPSICHORD, "7"], [Blockly.Msg.JOINT_MIDI_Celesta, "9"], [Blockly.Msg.JOINT_MIDI_Glockenspiel, "10"], [Blockly.Msg.JOINT_MIDI_Marimba, "13"], [Blockly.Msg.JOINT_MIDI_Xylophone, "14"], [Blockly.Msg.JOINT_MIDI_TubularBell, "15"], [Blockly.Msg.JOINT_MIDI_Dulcimer, "16"], [Blockly.Msg.JOINT_Lead, "81"], [Blockly.Msg.JOINT_Pad, "89"], [Blockly.Msg.JOINT_Steel_Drums, "115"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_set_midi_vol = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "volume",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_MESSAGE0
- })
- }
- };
- var note = [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Do, "60"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Re, "62"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Mi, "64"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Fa, "65"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Sol, "67"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_La, "69"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Si, "71"]];
- Blockly.Blocks.labplus_play_buzzer_note = {
- init: function () {
- this.jsonInit({
- colour: 192,
- args0: [{
- name: "note",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_play_midi_note = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "note",
- options: [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Do, "60"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Re, "62"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Mi, "64"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Fa, "65"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Sol, "67"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_La, "69"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Si, "71"]],
- type: "field_dropdown"
- }, {
- name: "status",
- options: [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE, "1"], [Blockly.Msg.LABPLUS_UART_OFF_MIDI_NOTE, "0"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_mp3_play = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "index",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_MP3_PLAY_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_MP3_PLAY_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_MP3_PLAY_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_mp3_set_volume = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "vol",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_mp3_set_status = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.STOP, "STOP"]]
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_init = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "tx",
- check: "Number",
- type: "input_value"
- }, {
- name: "rx",
- check: "Number",
- type: "input_value"
- }, {
- name: "baudrate",
- check: "Number",
- type: "input_value"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_INIT_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_INIT_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_INIT_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_any_msg_received = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]]
- }],
- helpUrl: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_MESSAGE0,
- output: "Boolean"
- })
- }
- };
- Blockly.Blocks.labplus_uart_read_msg = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]]
- }],
- helpUrl: Blockly.Msg.LABPLUS_UART_READ_MSG_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_READ_MSG_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_READ_MSG_MESSAGE0,
- output: ["Number", "String"]
- })
- }
- };
- Blockly.Blocks.labplus_uart_write_msg = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]]
- }, {
- type: "input_value",
- name: "msg0",
- check: ["Array", "String"]
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_WRITE_MSG_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_WRITE_MSG_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_WRITE_MSG_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_uart_set_oled = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- type: "input_dummy"
- }, {
- type: "input_value",
- name: "x1",
- check: "Number"
- }, {
- type: "input_value",
- name: "y1",
- check: "Number"
- }, {
- type: "input_value",
- name: "msg0",
- check: "String"
- }, {
- type: "field_dropdown",
- name: "font",
- options: [["Font 5x7", "0"], ["\u5b8b\u4f53 16x16", "1"], ["\u5b8b\u4f53 24x24", "2"], ["Consolas 32x32", "4"]]
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_MESSAGE0,
- inputsInline: !1
- })
- }
- };
- Blockly.Blocks.labplus_uart_set_lcd_clear = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- args0: [{
- type: "input_dummy"
- }, {
- type: "input_value",
- name: "x1",
- check: "Number"
- }, {
- type: "input_value",
- name: "y1",
- check: "Number"
- }, {
- type: "input_value",
- name: "x2",
- check: "Number"
- }, {
- type: "input_value",
- name: "y2",
- check: "Number"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_MESSAGE0,
- inputsInline: !1
- })
- }
- };
- Blockly.Blocks.labplus_uart_set_lcd_clear_all = {
- init: function () {
- this.jsonInit({
- colour: bluebitdigital,
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_MESSAGE0,
- inputsInline: !1
- })
- }
- };
- Blockly.Blocks.labplus_compitition_init_extended_pins = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "extendedPins",
- options: extendedPins,
- type: "field_dropdown"
- }, {
- name: "PinMode",
- options: [[Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_INPUT, "1"], [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_OUTPUT, "0"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_set_extio_mode = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- type: "input_dummy"
- }, {
- name: "mode0",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode1",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode2",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode3",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode4",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode5",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode6",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "mode7",
- options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_read_extended_pin = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "extendedPins",
- options: extendedPins,
- type: "field_dropdown"
- }],
- output: "Number",
- helpUrl: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_write_extended_pin = {
- init: function () {
- this.jsonInit({
- colour: bluebiti2c,
- args0: [{
- name: "extendedPins",
- options: extendedPins,
- type: "field_dropdown"
- }, {
- type: "input_value",
- name: "PinValue",
- check: "Number"
- }],
- nextStatement: null,
- previousStatement: null,
- helpUrl: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_MESSAGE0
- })
- }
- };
- Blockly.Blocks.labplus_mapping = {
- init: function () {
- this.jsonInit({
- colour: 230,
- args0: [{
- name: "inputNum",
- type: "input_value",
- check: "Number"
- }, {
- name: "bMin",
- type: "input_value",
- check: "Number"
- }, {
- name: "bMax",
- type: "input_value",
- check: "Number"
- }, {
- name: "cMin",
- type: "input_value",
- check: "Number"
- }, {
- name: "cMax",
- type: "input_value",
- check: "Number"
- }],
- output: "Number",
- message0: Blockly.Msg.labplus_mapping_MESSAGE0,
- tooltip: Blockly.Msg.labplus_mapping_TOOLTIP,
- helpUrl: Blockly.Msg.labplus_mapping_HELPURL
- })
- }
- };
- Blockly.Blocks.labplus_voice_record_on = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "func",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_VOICE_RECORD_PLAY, "play"], [Blockly.Msg.LABPLUS_VOICE_RECORD_REC, "rec"]]
- }, {
- name: "pinpair",
- type: "field_dropdown",
- options: labplus_pin_pair
- }],
- helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_voice_record_off = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "pinpair",
- type: "field_dropdown",
- options: labplus_pin_pair
- }],
- helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_motor_on = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "status",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "0"]]
- }, {
- name: "speed",
- type: "input_value",
- check: "Number"
- }, {
- name: "pinpair",
- type: "field_dropdown",
- options: labplus_pin_pair
- }],
- helpUrl: Blockly.Msg.LABPLUS_MOTOR_ON_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_MOTOR_ON_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_MOTOR_ON_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.labplus_motor_off = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "pinpair",
- type: "field_dropdown",
- options: labplus_pin_pair
- }],
- helpUrl: Blockly.Msg.LABPLUS_MOTOR_OFF_HELPURL,
- tooltip: Blockly.Msg.LABPLUS_MOTOR_OFF_TOOLTIP,
- message0: Blockly.Msg.LABPLUS_MOTOR_OFF_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- var microbit_ext2_color = "#c90370";
- Blockly.Blocks.microbit_ext2_set_servo = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- args0: [{
- name: "servo",
- type: "field_dropdown",
- options: [["S1", "1"], ["S2", "2"], ["S3", "3"], ["S4", "4"]]
- }, {
- name: "degree",
- type: "input_value",
- check: "Number"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_ext2_set_motor = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- args0: [{
- name: "motor",
- type: "field_dropdown",
- options: [["M1", "1"], ["M2", "2"], ["M3", "3"], ["M4", "4"]]
- }, {
- name: "dir",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "0"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "1"]]
- }, {
- name: "spd",
- type: "input_value",
- check: "Number"
- }],
- message0: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_HELPURL,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.microbit_ext2_stop_motor = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- args0: [{
- name: "motor",
- type: "field_dropdown",
- options: [["M1", "1"], ["M2", "2"], ["M3", "3"], ["M4", "4"]]
- }],
- message0: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_HELPURL,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.microbit_ext2_set_pwm = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- args0: [{
- name: "channel",
- type: "field_dropdown",
- options: [["S1", "1"], ["S2", "2"], ["S3", "3"], ["S4", "4"]]
- }, {
- name: "pwm",
- type: "input_value",
- check: "Number"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_EXT2_SET_PWM_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_SET_PWM_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_PWM_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_ext2_step_motor = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- args0: [{
- name: "motor",
- type: "field_dropdown",
- options: [["1", "1"], ["2", "2"]]
- }, {
- name: "dir",
- type: "field_dropdown",
- options: [[Blockly.Msg.LABPLUS_SET_MOTOR_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_SET_MOTOR_ANTI_CLOCKWISE, "0"]]
- }, {
- name: "speed",
- type: "input_value",
- check: "Number"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_ext2_sound_value = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_ext2_light_value = {
- init: function () {
- this.jsonInit({
- colour: microbit_ext2_color,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_HELPURL
- })
- }
- };
- Blockly.Blocks.botbit_setHSV = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_setHSV_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_setHSV_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_setHSV_MESSAGE0,
- args0: [{
- options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "4"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "5"]],
- type: "field_dropdown",
- name: "left_right"
- }, {
- check: "Number",
- type: "input_value",
- name: "h"
- }, {
- check: "Number",
- type: "input_value",
- name: "s"
- }, {
- check: "Number",
- type: "input_value",
- name: "v"
- }]
- })
- }
- };
- Blockly.Blocks.botbit_setRGB = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_setRGB_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_setRGB_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_setRGB_MESSAGE0,
- args0: [{
- options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "2"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "3"]],
- type: "field_dropdown",
- name: "left_right"
- }, {
- check: "Number",
- type: "input_value",
- name: "r"
- }, {
- check: "Number",
- type: "input_value",
- name: "g"
- }, {
- check: "Number",
- type: "input_value",
- name: "b"
- }]
- })
- }
- };
- Blockly.Blocks.botbit_turn = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_TURN_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_TURN_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_TURN_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "steps"
- }, {
- check: "Number",
- type: "input_value",
- name: "t"
- }, {
- options: [[Blockly.Msg.BOTBIT_MOTOR_FORWARD, "1"], [Blockly.Msg.BOTBIT_MOTOR_BACKWARD, "-1"]],
- type: "field_dropdown",
- name: "dir"
- }]
- })
- }
- };
- Blockly.Blocks.botbit_jump = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_JUMP_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_JUMP_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_JUMP_MESSAGE0,
- args0: [{
- check: "Number",
- type: "input_value",
- name: "t"
- }]
- })
- }
- };
- Blockly.Blocks.botbit_spd = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "spd",
- type: "field_dropdown",
- options: [["2000", "2000"], ["1000", "1000"], ["500", "500"], ["0", "0"], ["-500", "-500"], ["-1000", "-1000"], ["-2000", "-2000"]]
- }],
- helpUrl: "",
- tooltip: "",
- message0: "%1",
- output: "Number"
- })
- }
- };
- Blockly.Blocks.botbit_motor_on = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- type: "input_dummy"
- }, {
- name: "speedl",
- type: "input_value",
- check: "Number"
- }, {
- name: "speedr",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_MOTOR_ON_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_MOTOR_ON_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_MOTOR_ON_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_holdBall = {
- init: function () {
- this.jsonInit({
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_HOLDBALL_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_HOLDBALL_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_HOLDBALL_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_Steering_EngineL = {
- init: function () {
- this.jsonInit({
- colour: "#e8795b",
- args0: [
- {
- name: "dir",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_SERVO_X, "AcX"], [Blockly.Msg.BOTBIT_SERVO_Y, "AcY"], [Blockly.Msg.BOTBIT_SERVO_Z, "AcZ"]]
- }
- ],
- helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINEL_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINEL_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_STEERING_ENGINEL_MESSAGE0
- //nextStatement: null,
- //previousStatement: null
- })
- this.setOutput(!0);
- }
- };
- Blockly.Blocks.botbit_Steering_Tilt = {
- init: function () {
- this.jsonInit({
- colour: "#e8795b",
- args0: [
- {
- name: "dir",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_SERVO_X, "X"], [Blockly.Msg.BOTBIT_SERVO_Y, "Y"], [Blockly.Msg.BOTBIT_SERVO_Z, "Z"]]
- }
- ],
- helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINEL_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINEL_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_STEERING_ENGINET_MESSAGE0
- })
- this.setOutput(!0);
- }
- };
- Blockly.Blocks.botbit_Steering_RGB = {
- init: function () {
- var _input = this.appendDummyInput();
- _input.appendField(Blockly.Msg.X);
- this.appendValueInput("R").setCheck("Number");
- _input = this.appendDummyInput();
- _input.appendField(Blockly.Msg.Y)
- this.appendValueInput("G").setCheck("Number");
- _input = this.appendDummyInput();
- _input.appendField(Blockly.Msg.Y)
- this.appendValueInput("B").setCheck("Number");
- this.setInputsInline(!0);
- this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL);
- this.setColour("#5bb2d6");
- this.setOutput(!0, "Boolean");
- }
- };
- Blockly.Blocks.botbit_Steering_RGB = function (block) {
- var _r = Blockly.Python.valueToCode(block, "R", Blockly.Python.ORDER_ATOMIC);
- var _g = Blockly.Python.valueToCode(block, "G", Blockly.Python.ORDER_ATOMIC);
- var _b = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC);
- var code = "(" + _r + ", " + _g + ", " + _b + ")";
- return [code, Blockly.Python.ORDER_ATOMIC];
- };
- Blockly.Blocks.botbit_Steering_XY = {
- init: function () {
- var _input = this.appendDummyInput();
- this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL);
- this.setColour("#5bb2d6");
- this.setOutput(!0, "Boolean");
- _input.appendField(Blockly.Msg.X);
- this.appendValueInput("A").setCheck("Number");
- _input = this.appendDummyInput();
- _input.appendField(Blockly.Msg.Y)
- this.appendValueInput("B").setCheck("Number");
- this.setInputsInline(!0);
- }
- };
- Blockly.Python.botbit_Steering_XY = function (block) {
- var _x = Blockly.Python.valueToCode(block, "A", Blockly.Python.ORDER_ATOMIC);
- var _y = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC);
- var code = "(" + _x + ", " + _y + ")";
- return [code, Blockly.Python.ORDER_ATOMIC];
- };
- Blockly.Blocks.botbit_Steering_WH = {
- init: function () {
- var _input = this.appendDummyInput();
- this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL);
- this.setColour("#5bb2d6");
- this.setOutput(!0, "Boolean");
- _input.appendField(Blockly.Msg.W);
- this.appendValueInput("A").setCheck("Number");
- _input = this.appendDummyInput();
- _input.appendField(Blockly.Msg.H)
- this.appendValueInput("B").setCheck("Number");
- this.setInputsInline(!0);
- }
- };
- Blockly.Python.botbit_Steering_WH = function (block) {
- var _x = Blockly.Python.valueToCode(block, "A", Blockly.Python.ORDER_ATOMIC);
- var _y = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC);
- var code = "(" + _x + ", " + _y + ")";
- return [code, Blockly.Python.ORDER_ATOMIC];
- };
- Blockly.Blocks.botbit_Steering_Engine_leg = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "leg",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_MOTOR_LEFT, "l"], [Blockly.Msg.BOTBIT_MOTOR_RIGHT, "r"]]
- }, {
- name: "dir",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_SERVO_UP, "y"], [Blockly.Msg.BOTBIT_SERVO_DOWN, "x"]]
- }, {
- name: "walk",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_updatePosition = {
- init: function () {
- this.jsonInit({
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_UPDATEPOSITION_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_UPDATEPOSITION_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_UPDATEPOSITION_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_Ultrasonic = {
- init: function () {
- this.jsonInit({
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_ULTRASONIC_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_ULTRASONIC_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_ULTRASONIC_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.botbit_walking = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "fx",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_WALKING_FORWARD, "-1"], [Blockly.Msg.BOTBIT_WALKING_BACK, "1"]]
- }, {
- name: "steps",
- type: "input_value",
- check: "Number"
- }, {
- name: "T",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_WALKING_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_WALKING_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_WALKING_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_moonwalker = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "fx",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "-1"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "1"]]
- }, {
- name: "steps2",
- type: "input_value",
- check: "Number"
- }, {
- name: "T2",
- type: "input_value",
- check: "Number"
- }, {
- name: "amplitude",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_MOONWALKER_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_MOONWALKER_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_MOONWALKER_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_PIDtracking = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- type: "input_dummy"
- }, {
- name: "kp",
- type: "input_value",
- check: "Number"
- }, {
- name: "kd",
- type: "input_value",
- check: "Number"
- }, {
- name: "trackSpeed",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_PIDtracking_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_PIDtracking_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_PIDtracking_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_crusaito = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "fx",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_CRUSAITO_CW, "-1"], [Blockly.Msg.BOTBIT_CRUSAITO_ANTICW, "1"]]
- }, {
- name: "steps3",
- type: "input_value",
- check: "Number"
- }, {
- name: "T3",
- type: "input_value",
- check: "Number"
- }, {
- name: "amplitude3",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_CRUSAITO_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_CRUSAITO_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_CRUSAITO_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_flapping = {
- init: function () {
- this.jsonInit({
- colour: 30,
- args0: [{
- name: "fx",
- type: "field_dropdown",
- options: [[Blockly.Msg.BOTBIT_FLAPPING_FORWARD, "-1"], [Blockly.Msg.BOTBIT_FLAPPING_BACK, "1"]]
- }, {
- name: "steps4",
- type: "input_value",
- check: "Number"
- }, {
- name: "T4",
- type: "input_value",
- check: "Number"
- }, {
- name: "amplitude4",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.BOTBIT_FLAPPING_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_FLAPPING_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_FLAPPING_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.botbit_home = {
- init: function () {
- this.jsonInit({
- colour: 30,
- helpUrl: Blockly.Msg.BOTBIT_HOME_HELPURL,
- tooltip: Blockly.Msg.BOTBIT_HOME_TOOLTIP,
- message0: Blockly.Msg.BOTBIT_HOME_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.Carbit_init = {
- init: function () {
- this.jsonInit({
- colour: 88,
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.Carbit_init_MESSAGE0,
- tooltip: Blockly.Msg.Carbit_init_TOOLTIP,
- helpUrl: Blockly.Msg.Carbit_init_HELPURL
- })
- }
- };
- Blockly.Blocks.Carbit_setLeftMotor = {
- init: function () {
- this.jsonInit({
- colour: 88,
- args0: [{
- name: "LeftMotor",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.Carbit_setLeftMotor_HELPURL,
- tooltip: Blockly.Msg.Carbit_setLeftMotor_TOOLTIP,
- message0: Blockly.Msg.Carbit_setLeftMotor_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.Carbit_setRightMotor = {
- init: function () {
- this.jsonInit({
- colour: 88,
- args0: [{
- name: "RightMotor",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.Carbit_setRightMotor_HELPURL,
- tooltip: Blockly.Msg.Carbit_setRightMotor_TOOLTIP,
- message0: Blockly.Msg.Carbit_setRightMotor_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- Blockly.Blocks.Carbit_analog_light = {
- init: function () {
- this.jsonInit({
- colour: 88,
- args0: [{
- name: "light",
- type: "field_dropdown",
- options: [["Q3", "1"], ["Q4", "2"]]
- }],
- helpUrl: Blockly.Msg.Carbit_analog_light_HELPURL,
- tooltip: Blockly.Msg.Carbit_analog_light_TOOLTIP,
- message0: Blockly.Msg.Carbit_analog_light_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.Carbit_Speed_U10 = {
- init: function () {
- this.jsonInit({
- colour: 88,
- helpUrl: Blockly.Msg.Carbit_Speed_U10_HELPURL,
- tooltip: Blockly.Msg.Carbit_Speed_U10_TOOLTIP,
- message0: Blockly.Msg.Carbit_Speed_U10_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.Carbit_Speed_U11 = {
- init: function () {
- this.jsonInit({
- colour: 88,
- helpUrl: Blockly.Msg.Carbit_Speed_U11_HELPURL,
- tooltip: Blockly.Msg.Carbit_Speed_U11_TOOLTIP,
- message0: Blockly.Msg.Carbit_Speed_U11_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.Carbit_Distance = {
- init: function () {
- this.jsonInit({
- colour: 88,
- helpUrl: Blockly.Msg.Carbit_Distance_HELPURL,
- tooltip: Blockly.Msg.Carbit_Distance_TOOLTIP,
- message0: Blockly.Msg.Carbit_Distance_MESSAGE0,
- output: "Number"
- })
- }
- };
- Blockly.Blocks.Carbit_tracking = {
- init: function () {
- this.jsonInit({
- colour: 88,
- args0: [{
- type: "input_dummy"
- }, {
- name: "k_speed",
- type: "input_value",
- check: "Number"
- }, {
- name: "speedMax",
- type: "input_value",
- check: "Number"
- }, {
- name: "speedScale",
- type: "input_value",
- check: "Number"
- }, {
- name: "turnDelay",
- type: "input_value",
- check: "Number"
- }],
- helpUrl: Blockly.Msg.Carbit_tracking_HELPURL,
- tooltip: Blockly.Msg.Carbit_tracking_TOOLTIP,
- message0: Blockly.Msg.Carbit_tracking_MESSAGE0,
- nextStatement: null,
- previousStatement: null
- })
- }
- };
- var gamebitColor = 230;
- Blockly.Blocks.gamebit_xy = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- output: "Number",
- colour: gamebitColor,
- helpUrl: Blockly.Msg.GAMEBIT_XY_HELPURL,
- tooltip: Blockly.Msg.GAMEBIT_XY_TOOLTIP,
- message0: Blockly.Msg.GAMEBIT_XY_MESSAGE0,
- args0: [{
- options: [["X", "2"], ["Y", "1"]],
- type: "field_dropdown",
- name: "xy"
- }]
- })
- }
- };
- Blockly.Blocks.gamebit_shake = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- nextStatement: null,
- previousStatement: null,
- colour: gamebitColor,
- helpUrl: Blockly.Msg.GAMEBIT_SHAKE_HELPURL,
- tooltip: Blockly.Msg.GAMEBIT_SHAKE_TOOLTIP,
- message0: Blockly.Msg.GAMEBIT_SHAKE_MESSAGE0,
- args0: [{
- options: [[Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"], [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"]],
- type: "field_dropdown",
- name: "shake"
- }]
- })
- }
- };
- Blockly.Blocks.gamebit_button = {
- init: function () {
- this.jsonInit({
- inputsInline: !0,
- output: "Boolean",
- colour: gamebitColor,
- helpUrl: Blockly.Msg.GAMEBIT_BUTTON_HELPURL,
- tooltip: Blockly.Msg.GAMEBIT_BUTTON_TOOLTIP,
- message0: Blockly.Msg.GAMEBIT_BUTTON_MESSAGE0,
- args0: [{
- options: [["START", "6"], ["SElECT", "7"], ["A", "4"], ["B", "3"], ["X", "2"], ["Y", "1"], ["Z", "5"]],
- type: "field_dropdown",
- name: "button"
- }]
- })
- }
- };
- var COLOR_MU = "#FF6600";
- Blockly.Blocks.microbit_mu_init = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "address",
- options: [["0x60", "0x60"], ["0x61", "0x61"], ["0x62", "0x62"], ["0x63", "0x63"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_INIT_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_INIT_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_INIT_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_begin = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "vision_type"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_BEGIN_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_BEGIN_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_BEGIN_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_vision_type_multi = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- checked: !1,
- type: "field_checkbox",
- name: "type1"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type2"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type3"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type4"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type5"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type6"
- }, {
- type: "input_dummy"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type7"
- }, {
- checked: !1,
- type: "field_checkbox",
- name: "type8"
- }],
- output: "String",
- message0: Blockly.Msg.MICROBIT_MU_VISION_TYPE_MESSAGE0,
- tooltip: "",
- helpUrl: ""
- })
- }
- };
- Blockly.Blocks.microbit_mu_vision_type = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "vision_type",
- options: [[Blockly.Msg.MICROBIT_MU_VISION_COLOR_DETECT, "VISION_COLOR_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_COLOR_RECOGNITION, "VISION_COLOR_RECOGNITION"], [Blockly.Msg.MICROBIT_MU_VISION_BALL_DETECT, "VISION_BALL_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_BODY_DETECT, "VISION_BODY_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_SHAPE_CARD_DETECT, "VISION_SHAPE_CARD_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_TRAFFIC_CARD_DETECT, "VISION_TRAFFIC_CARD_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_NUM_CARD_DETECT, "VISION_NUM_CARD_DETECT"]],
- type: "field_dropdown"
- }],
- output: "String",
- message0: "%1",
- tooltip: "",
- helpUrl: ""
- })
- }
- };
- Blockly.Blocks.microbit_mu_set_level = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "vision_type"
- }, {
- name: "level",
- options: [[Blockly.Msg.MICROBIT_MU_LEVEL_DEFAULT, "LevelDefault"], [Blockly.Msg.MICROBIT_MU_LEVEL_SPEED, "LevelSpeed"], [Blockly.Msg.MICROBIT_MU_LEVEL_BALANCE, "LevelBalance"], [Blockly.Msg.MICROBIT_MU_LEVEL_ACCURACY, "LevelAccuracy"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_SET_LEVEL_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_SET_LEVEL_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_SET_LEVEL_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_get_level = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "vision_type"
- }],
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_GET_LEVEL_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_GET_LEVEL_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_GET_LEVEL_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_set_fps_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "mode",
- options: [[Blockly.Msg.MICROBIT_MU_FPS_NORMAL, "FPSNormal"], [Blockly.Msg.MICROBIT_MU_FPS_HIGH, "FPSHigh"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_get_fps_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_set_awb_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "mode",
- options: [[Blockly.Msg.MICROBIT_MU_AUTO_WHITE_BALANCE, "AutoWhiteBalance"], [Blockly.Msg.MICROBIT_MU_LOCK_WHITE_BALANCE, "LockWhiteBalance"], [Blockly.Msg.MICROBIT_MU_WHITE_LIGHT, "WhiteLight"], [Blockly.Msg.MICROBIT_MU_YELLOW_LIGHT, "YellowLight"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_get_awb_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_set_zoom_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "mode",
- options: [[Blockly.Msg.MICROBIT_MU_ZOOM_DEFAULT, "ZoomDefault"], [Blockly.Msg.MICROBIT_MU_ZOOM_1, "Zoom1"], [Blockly.Msg.MICROBIT_MU_ZOOM_2, "Zoom2"], [Blockly.Msg.MICROBIT_MU_ZOOM_3, "Zoom3"], [Blockly.Msg.MICROBIT_MU_ZOOM_4, "Zoom4"], [Blockly.Msg.MICROBIT_MU_ZOOM_5, "Zoom5"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_get_zoom_mode = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_set_default = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_restart = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_RESTART_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_RESTART_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_RESTART_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_led_level = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "level",
- options: [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["10", "10"], ["11", "11"], ["12", "12"], ["13", "13"], ["14", "14"], ["15", "15"]],
- type: "field_dropdown"
- }],
- output: "Number",
- message0: "%1",
- tooltip: "",
- helpUrl: ""
- })
- }
- };
- Blockly.Blocks.microbit_mu_led_set_color = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "led",
- options: [["Led1", "Led1"], ["Led2", "Led2"], ["LedAll", "LedAll"]],
- type: "field_dropdown"
- }, {
- check: "Number",
- type: "input_value",
- name: "level"
- }, {
- name: "detected_color",
- options: [[Blockly.Msg.MICROBIT_MU_LED_CLOSE, "LedClose"], [Blockly.Msg.MICROBIT_MU_LED_RED, "LedRed"], [Blockly.Msg.MICROBIT_MU_LED_GREEN, "LedGreen"], [Blockly.Msg.MICROBIT_MU_LED_YELLOW, "LedYellow"], [Blockly.Msg.MICROBIT_MU_LED_BLUE, "LedBlue"], [Blockly.Msg.MICROBIT_MU_LED_PURPLE, "LedPurple"], [Blockly.Msg.MICROBIT_MU_LED_CYAN, "LedCyan"], [Blockly.Msg.MICROBIT_MU_LED_WHITE, "LedWhite"]],
- type: "field_dropdown"
- }, {
- type: "input_dummy"
- }, {
- name: "undetected_color",
- options: [[Blockly.Msg.MICROBIT_MU_LED_CLOSE, "LedClose"], [Blockly.Msg.MICROBIT_MU_LED_RED, "LedRed"], [Blockly.Msg.MICROBIT_MU_LED_GREEN, "LedGreen"], [Blockly.Msg.MICROBIT_MU_LED_YELLOW, "LedYellow"], [Blockly.Msg.MICROBIT_MU_LED_BLUE, "LedBlue"], [Blockly.Msg.MICROBIT_MU_LED_PURPLE, "LedPurple"], [Blockly.Msg.MICROBIT_MU_LED_CYAN, "LedCyan"], [Blockly.Msg.MICROBIT_MU_LED_WHITE, "LedWhite"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_get_value = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "vision_type"
- }, {
- name: "object_inf",
- options: [[Blockly.Msg.MICROBIT_MU_VALUE_STATUS, "Status"], [Blockly.Msg.MICROBIT_MU_VALUE_XVALUE, "XValue"], [Blockly.Msg.MICROBIT_MU_VALUE_YVALUE, "YValue"], [Blockly.Msg.MICROBIT_MU_VALUE_WIDTHVALUE, "WidthValue"], [Blockly.Msg.MICROBIT_MU_VALUE_HEIGHTVALUE, "HeightValue"], [Blockly.Msg.MICROBIT_MU_VALUE_LABEL, "Label"], [Blockly.Msg.MICROBIT_MU_VALUE_RVALUE, "RValue"], [Blockly.Msg.MICROBIT_MU_VALUE_GVALUE, "GValue"], [Blockly.Msg.MICROBIT_MU_VALUE_BVALUE, "BValue"]],
- type: "field_dropdown"
- }],
- output: null,
- message0: Blockly.Msg.MICROBIT_MU_GET_VALUE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_GET_VALUE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_GET_VALUE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_type = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "ls_type",
- options: [[Blockly.Msg.MICROBIT_MU_LS_PROXIMITY_ENABLE, "LS_PROXIMITY_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_AMBIENT_LIGHT_ENABLE, "LS_AMBIENT_LIGHT_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_ENABLE, "LS_COLOR_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_GESTURE_ENABLE, "LS_GESTURE_ENABLE"]],
- type: "field_dropdown"
- }],
- output: "String",
- message0: "%1",
- tooltip: "",
- helpUrl: ""
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_begin = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "ls_type"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_LS_BEGIN_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_BEGIN_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_BEGIN_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_end = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- check: "String",
- type: "input_value",
- name: "ls_type"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_LS_END_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_END_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_END_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_set_sensitivity = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "sensitivity",
- options: [[Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_DEFAULT, "SensitivityDefault"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_1, "Sensitivity1"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_2, "Sensitivity2"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_3, "Sensitivity3"]],
- type: "field_dropdown"
- }],
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_wb_enable = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- nextStatement: null,
- previousStatement: null,
- message0: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_read_proximity = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_read_ambient_light = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_read_color = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- args0: [{
- name: "color_t",
- options: [[Blockly.Msg.MICROBIT_MU_LS_COLOR_LABEL, "LsColorLabel"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_RED, "LsColorRed"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_GREEN, "LsColorGreen"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_BLUE, "LsColorBlue"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_RED, "LsRawColorRed"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_GREEN, "LsRawColorGreen"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_BLUE, "LsRawColorBlue"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_HUE, "LsColorHue"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_SATURATION, "LsColorSaturation"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_VALUE, "LsColorValue"]],
- type: "field_dropdown"
- }],
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_HELPURL
- })
- }
- };
- Blockly.Blocks.microbit_mu_ls_read_gesture = {
- init: function () {
- this.jsonInit({
- colour: COLOR_MU,
- output: "Number",
- message0: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_MESSAGE0,
- tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_TOOLTIP,
- helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_HELPURL
- })
- }
- };
|