In our previous article we have seen to control three LED's together using the Arduino and the software is developed using Stateflow as a state machine. In this article we will look at generating the software from the Simulink blocks to read the potentiometer value and showing that as a binary value using three LED's.
Required components
- Three LEDs
- Arduino
- Connecting Wires
- Three Resistors
- Matlab or Arduino IDE
- Potentiometer
The idea is to read the potentiometer reading using Arduino and converting the read value from 0 to 1023 scale to 1 to 4 scale. So all the potentiometer values from 0 to 256 are represented using 1 and 257 to 512 are represented using 2 and so on.
Software creation for Arduino using Simulink
In our earlier posts we have seen using the stateflow, in this article we see the Simulink in action all of the software is developed using Simulink graphically. At the end the Simulink model is deployed to the Arduino using Simulink embedded coder.
Following video explains the software creation to read and process the analog value using Arduino and Simulink.
In the next article we will explore the code generation and deployment to the hardware along with demo.
No comments:
Post a Comment