Advertisement
baldengineer

const optimizations check

Sep 14th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1.  
  2. const byte debug=0;
  3.  
  4. void setup() {
  5.   // put your setup code here, to run once:
  6.  if (debug) Serial.begin(9600);
  7.   pinMode(13, OUTPUT);
  8. }
  9.  
  10. void loop() {
  11.   // put your main code here, to run repeatedly:
  12.   digitalWrite(13, HIGH);
  13.   if (debug) Serial.print("High");
  14.   delay(1000);
  15.   digitalWrite(13, LOW);
  16.   if (debug) Serial.print("Low");
  17.   delay(1000);
  18.  
  19. }
  20.  
  21. // const byte debug = 1, program size: 2,332 bytes
  22. // const byte debug = 0, program size 1,030 bytes
  23. // Serial Commented Out, program size: 1,030 bytes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement