The IP address and mac address have been fixed to arbitrary numbers – that must be unique on the local network. It is always good to start from something that works.Ĭonnect the Arduino to a PC via USB and the router via Ethernet, and start the Arduino IDE. Then we put the two together so the Arduino serves our webpage and add some code so we can drive the LED. We then write our own simple webpage with a button that will control the LED. The starting point the standard Arduino webserver sketch – that can be logged onto to see a webpage. Code in the Arduino detects this and turns the LED on or off as directed. Users can log onto the webpage and click the button. The Arduino serves a webpage with a button. This does not require any special apps for the phone or signing up to any service – It just uses the standard (free) Arduino code plus some new code, shown here, to enable it to control the LED.ġ Arduino UNO or other type as long as it has the standard connection layout for shields, plus USB cableģ LED and resistor (suggest 180ohms with white or blue LED and 330ohms with Red, Yellow or Green LED)Ħ Mobile phone (can use the PC/laptop instead)ĭownload the Arduino IDE (integrated development environment) from: It should also inspire confidence both in writing html/webpages and adapting standard Arduino code to achieve a new task. This can be completed in 45 mins with the students doing all the actions/coding. The original objective was a school example supporting STEM (Science Technology Engineering and Maths). It also shows how to write a simple web page in html. The purpose of this instructable to show some practical coding including how to modify a standard Arduino sketch to do something extra – in this case controlling a LED from a mobile phone.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |