ADC Community_02 (Automationdirect.com) asked a question.

Code Block Formatting

When posting code into a forum post we are requesting that you format like the example below to provide guidance and set format to promote consistency:

 

Purpose: Describe the purpose, scope and/or goal of what your code is achieving.

Example:

Turns an LED on for one second, then off for one second, repeatedly.

 

Dependencies: List any required dependencies or libraries invokes another object's functionality in order to accomplish some specific task.

Example:

https://github.com/arduino-libraries/ArduinoModbus

https://github.com/arduino-libraries/ArduinoRS485

 

Code: Ensure you use the code snippet optionunder the advanced editor when placing your code into the post. ( You may also want to include a text file of your code since this forum will not preserve formatting options when pasting into a code block.)

Example:

  1. /*
  2. Blink
  3. Turns an LED on for one second, then off for one second, repeatedly.
  4. */
  5. // the setup function runs once when you press reset or power the board
  6. void setup() {
  7. // initialize digital pin LED_BUILTIN as an output.
  8. pinMode(LED_BUILTIN, OUTPUT);
  9. }
  10. // the loop function runs over and over again forever
  11. void loop() {
  12. digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
  13. delay(1000); // wait for a second
  14. digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
  15. delay(1000); // wait for a second
  16. }

 


AL9000 and kewakl like this.