analog read doesnt work on 16u2? #131
Replies: 2 comments
-
|
i read the wiki and it sead to solder missing pins? wtf? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
oh |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I plugged a joycon module into my elegoo uno R3, and sent its readings to A1, A2, A3, setting its board to hoodloader uno and changing the A to PC, it still could read the values, but changing it to hoodloader 16u2, analog read just returns 0? and i need 16u2 as i want to use my board as a HID! heres my code:
#include <HID-Project.h>
#include <HID-Settings.h>
void setup() {
Serial.begin(9600);
Mouse.begin();
}
void loop() {
int xPos = analogRead(PC1);
int yPos = analogRead(PC2);
Serial.print(xPos);
Serial.print(',');
Serial.println(yPos);
Mouse.move(1 ? yPos > 1000 : -1 ? yPos < 500 : 0, 1 ? xPos > 1000 : -1 ? xPos < 500 : 0);
}
Beta Was this translation helpful? Give feedback.
All reactions