Arduino UNO
16x2 LCD Display
5 Switches (Up, Down, Left, Right, Enter)
Write a sketch that will allow the Arduino to query data from a serial connection, display it on the LCD.
Use five button input to change values and send data via a serial string.
The Display will read:
“Lan Settings”
or
“SSID”
Scrolling from one to the other with up/down button press.
Selecting Enter button on Lan Settings or SSID will Enter a sub menu
Lan Settings – Submenu Items
“IP”
“Subnet”
“Gateway”
Scrolling from through the list with up/down button press.
Selecting Enter button on selects the setting.
Enter on IP:
First line with Display “IP”
Second line with Display IP value which is retrieved by sending the rs232 string:
“:put [/ip add get [/ip add find interface=ether3] address”
Your will get a response:
Ie: [login to view URL]
We need to parse off the /24 and display the IP on the second line of the LCD display,
Filling in characters so each octet is three charater, ie: [login to view URL]
Pressing left and right button with move the a cursor to each octet.
Up and down will change the value of the octet with a range of 0 to 255.
Pressing enter will send the serial command
“/ip add set [/ip add find interface=ether3] address=[login to view URL]
Note: we add back the /24 we parsed earlier.
Enter on Subnet:
First line of Display will display “subnet”
Second line will Display IP value which is received by sending the rs232 string:
“:put [/ip add get [/ip add find interface=ether3] address”
Your will get a response of:
Ie: 192.1668.0.5/24
Parse IP and leave cidr of /24, covert to subnet mask ie. [login to view URL]
Change value as above
Pressing enter will send the serial command:
“/ip add set [/ip add find interface=ether3] address=x.x.x.x/24
Note: We add back the IP we parsed earlier.
Enter on Gateway:
First line will display “Gateway”
Second line will display Gateway value which is received by sending the rs232 string:
:put [/ip route get [/ip route find dst-address=0.0.0.0/0] gateway]
Your will get a response ie.
[login to view URL], display as three character per octet [login to view URL]
Change values as above, up enter send serial command:
/ip route set [/ip route find dst-address=0.0.0.0/0] gateway=x.x.x.x
After entering the value on each of the above submenus the display should return to the scroll “IP, SUBNET, GATEWAY”
The back button brings you back to the scroll
“LAN Settings”
“SSID”
Enter on SSID
Display SSID on first line of LCD
Second line display SSID, get SSID with serial string:
:put [/int w get [/int w find name=wlan1] ssid]
Display will return, ie “TEST”
Change values of TEST with up down A-Z *&^%$#@!
Send value of ssid with serial string
/int w set [/int w find name=wlan1] ssid=x]
I have a masters in electrical engineering from Arizona State University, and have more than 5 years of experience with programming micro-controller boards. I have worked on both TI and Arduino boards.