Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- Serial.begin(115200);
- }
- // 0=> 0
- // 47=> 100
- // 94=> 200
- // 141=> 300 (still following 47 * n)
- // 192=> 400 (1 mark off)
- // 246=> 500 (2 mark off)
- static int MIN_METER = 0;
- static int MAX_METER = 246;
- void loop() {
- int value = Serial.parseInt();
- if(value != 0) {
- value = value;
- Serial.println(value);
- analogWrite(5, value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement