CSS Example: Arduino IDE Copy as HTML Feature |
A straightforward example of CSS inline styles can be explored using the Copy as HTML feature of the Arduino IDE. When editing a sketch, the code appears to the viewer as follows,
/** * PURPOSE: * AUTHOR: * DATE: * COMMENT: */ int bits [] = { 11,8,6,3}; int duration = 200; int number = 0; int limit = 16; void setup(){ for(int i=0; i<=3; i++) pinMode(bits[i], OUTPUT); } void loop(){ for(int i=0; i<=3; i++) digitalWrite(bits[i],number & 1<<(3-i)); delay(duration); // modular advance of the number number = (number+1) % limit; }
When the Copy as HTML feature is used to present the code in a web page, the HTML looks like this (the numbered lines have been included for reference purposes only),