In this simple example, we press a button in Unity repeatedly. Then Arduino turns on and off the built-in LED and also changes the button text and color.
Unity windows will looks like above, if you import MiniLab unity package. There are 8 Controls (UI parts) as prefabs in Assets folder. Here a Push button Control is dragged from there into the scene. The corresponding Arduino code is as shown above.
The overall codes were generated by a menu in the Inspector when Bench selected in the hierarchy window. In the MiniLab's Inspector we set Baud Rate and Port (COM) number.
Press the Play button in Unity, and click the Push button repeatedly. You will see the button text change between "Hello" and "World", with button color changes. You will also hear system sounds.
Comments
Please log in or sign up to comment.