Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup(){
- Serial.begin(9600);
- }
- void loop(){
- int value = analogRead(A0);
- Serial.print(value / 1024.0 * 5.0);
- Serial.print('\t');
- Serial.print(value / 1024.0 * 100.0);
- Serial.println("%");
- analogWrite(3, map(value, 0, 1024, 0, 255));
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement