Grove -Rotary Angle Sensor
This project will read a Grove Rotary Angle Sensor.
- Connect a Rotary Angle Sensor to an analog grove connector on your board.
- Begin a new Grove project using the Grove Project Import method at the bottom of this page.
- In the Project Explorer on the left, under Sources, double click to open the file "arduinoApp.cpp".
- Copy and paste the following code into this file to replace it's contents:
//--------- Rotary Angle Sensor Test
int analogPin = 0; // Rotary Angle Sensor connected to this analog pin void setup() void loop() delay(1000); // wait 1 second |
- This code will ouput the value of the current position of the rotary sensor to the serial port every second.
- Select Project from the main menu and choose Build Project.
- If there are any errors they will be displayed in the Problems tab.
Now follow the steps under Debugging your ARM Board Project.