Let’s check the stocks in secret! My precious stocks! I might have a misfortune to lose my job if I get caught by my boss when I check out the stocks during work. Let’s use Arduino to check the stocks! Don’t worry, my boss doesn’t know what it is.
STEP 1. <Project or Technology Introduction>
Let’s take the stock price information from the Korea Exchange in XML format, parse them, and check the stock exchange rate with a servomotor by using WIZarduino WiFi.
STEP 2. <Materials>
STEP 3. <Hardware Configuration>
1. Connect Wizarduino and a servomotor. Brown: GND, Red: 5V, Orange: pin 9 (At this time, gender-bender is required since the servomoter connector and Wizarduino connector are equally female.)
- After connecting PC and Wizarduino, click the link below!
Click “ADD to MY SKETCHBOOK” (If you have not joined Arduino or Arduino online IDE, you should join)
- Revise the filled area with xxxxx on 4th, 5th, and 6th line in the ino file. 4th line: router ID, 5th line: router password, 6th line: stock code that you want to check out
- Press the arrow button to download the program to the board and select the Monitor menu to check it works properly.(The servo motor moves left and right if uploaded normally.)
- Now you decorate it so the boss can not notice.
STEP 4. <Source Code links and key code descriptions>
The source code is in the Arduino Online IDE and you can add it by clicking on the link below.
The most important part of this project is to parse the content after “TBL_StockInfo” among the XML data received via HTTP. Also, it is not easy to convert the price of a stock in to a number, so please refer to that part as well.
STEP 5. <Project result>
The stock price is updated once every 5 seconds and the right end shows -30% and the left end shows +30%.
Wizarduino makes it easier to present stock quotes in different ways. It can be displayed in various ways such as LED or servo motor. There are a lot of public data provided by the government in addition to stock quotes. Now the idea becomes a reality.