/**
* Copyright(C), 2018-2038, KenRobot.com
* FileName: 我的项目.ino
* Author: 啃萝卜
* Create: 2019/07/27
* Modify: 2019/07/27
*/
#include <LedControl.h>
LedControl ledControl_0 = LedControl(5, 4, 3, 1);
int pot_0 = A1;
void setup() {
ledControl_0.shutdown(0, false);
ledControl_0.setIntensity(0, 8);
ledControl_0.clearDisplay(0);
pinMode(pot_0, INPUT);
Serial.begin(9600);
}
void loop() {
ledControl_0.setLed(0, 0, 0, true);
float rot = analogRead(pot_0);
float deg = rot*2*PI/1023;
float x = cos(deg) * 3 + 3;
float y = sin(deg) * 3 + 3;
ledControl_0.clearDisplay(0);
ledControl_0.setLed(0, round(x), round(y), true);
Serial.println(deg);
delay(20);
}