Soif I usesomethinglikethislittleUSBbatterypack, I canhavethiscompletely, completelyseparatedfromanyothercomputersystem, beabletointeractwiththeWiFiboard, usingmymyWebbrowserandbeabletoturnonandoff.
Thisledagainwithoutthishavingtobeconnectedto a computeratall.
Sowiththat, let's goovertothecomputerso I canshowyouthecodeonthisthing.
Sohere's thecodeforthislittleproject.
Itseeitmayseem a littlebitcomplicated, butasalways, ifyoureadthroughit, youwillstarttounderstandwhat's goingon.
Sothefirstthingthatwe'regoingtoneedtodoiswe'regoingtoneedtoincludethatnetworkinglibrariessothatthisarteryno, youknow, withwife I canactuallycommunicateoverWiFi s goingtopoundincludeOrionincludetheSP I libraryandtheWiFininelibrariesaregoingincludethosetwolibraries.
Thenextthingthatwe'regoingtodoitsincewe'regoingtobeturningandled a lightonandoff, weneedtodefine a pinforthatledlightofdigitalpenwe'regonnapoundtofindWe'rejustgonnacallitled, anditwillbedigitalpinnumbernine.
Ifyouhave a password, youwouldpluckitinhere, thenendkeyindex.
Ifyouhavemultiplekeys.
DifferentnumberedkeysforyourWiFinetwork.
Youwouldputthekeyindexhere 012345 I'm notworriedaboutthat, so I justhaveitatzeronow, Thentocomedown, wehavetocreate a variableforthestatusofourWiFinetwork.
Sowe'regonnacreatethatendstatusequalscurrentlybasically w l idolstatus.
Andthenwhenyougetto a newline, thenitknowstobe a bit.
SendsomethingbacktotheWebbrowser.
Well, theinterestingthinghereisnotonlyarewegoingtohaveusedthistoparseonknowwhentosendsomethingtotheWebbrowser, butwe'realsoactuallygoingtousethisinordertoreadwhat's inthe U.
R L sothatwecanthendeterminewhetherornottoturnthelightonoroff.
Soifwecomedownheretobe, ifelsestatementsdownhere, basicallywhatthisdoesissays, read a stringdotindexofSobasicallylooksatwhat's insidethereedstringvariable.
Andifitifitislighton, soifit's greaterthanzero.
Sobasically, ifthisexistswithinthatyouare l thenturnthelightonelse.
Backslashisovertheseescapesanywhereyouseesomethinglike a doublequotationmarkandyou'regonnabesendingthatinformationsomewherethattheartweknowitselfisn't supposedtopayattentiontomakesuretoputthatescape.
Soifyou'reIfyoulookatsomethinglikethisandallof a suddenyouseeblackandhereseehowthisisblue, andthenallof a sudden, thispartisblack.
You'llnoticethere's a coupleofdelaysinhere, andthisissomethingagainwhenyou'reCodyandyouhavetoplaywithwhateveryou'redealingwithforsomereasonwhenyou'rewhenyou'redealingwiththiswiththeyard, weknowyouknowwithWiFi.
Ifyougiveitjust a slightlittlebitofdelay, yougiveit a littlebitoftimetothinkaboutwhatisdoing.
Oneinterestingthingis, it's lookingforthis, Soaslongasthisisthere, itwillfunctionsoliterallyif I wentuphereand I went 1111111 Right, Soaslongasitseesthisright, that's allit's lookingfor.