Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int horz = analogRead(HORZ_PIN);
- int vert = analogRead(VERT_PIN);
- if (vert < 300) {
- y = min(y + 1, maxY);
- }
- if (vert > 700) {
- y = max(y - 1, 0);
- }
- if (horz > 700) {
- x = min(x + 1, maxX);
- }
- if (horz < 300) {
- x = max(x - 1, 0);
- }
- if (digitalRead(SEL_PIN) == LOW) {
- mx.clear();
- }
- mx.setPoint(y, x, true);
- mx.update();
- delay(100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement