Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- period = 256;
- on_time = 34; // Or whatever you want
- off_time = period-on_time;
- count = 0;
- while (1);
- {
- if (count >= 0) {
- count -= off_time;
- output_high();
- } else {
- count += on_time;
- output_low();
- }
- wait_for_next_cycle();
- }
Add Comment
Please, Sign In to add comment