Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Autor: Lendwai
- Name: LedLeuchtenKontrolle
- Datum: 27.2.2017
- ----------------------------------------
- History:
- ----------------------------------------
- Programmbeschreibung:
- */
- int input = 0;
- float pwm = 0.0;
- int intpwm = 0;
- float dc = 0.0;
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- input = analogRead(A0);
- pwm = input / 4;
- dc = pwm / 255;
- dc = dc * 100;
- intpwm = pwm;
- Serial.print("Input:");
- Serial.print(input);
- Serial.print(" ");
- Serial.print("PWM:");
- Serial.print(intpwm);
- Serial.print(" ");
- Serial.print("DC:");
- Serial.print(dc);
- Serial.print("%");
- Serial.println();
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement