Day 4 – Lost in Space

PinMode (in Setup):

-Switches – input

-LEDs – output

// #define CABIN_LIGHTS_PIN 10 // pin controlling the cabin lights
// #define STORAGE_LIGHTS_PIN 11 // pin controlling the storage lights
// #define COCKPIT_LIGHTS_PIN 12 // pin controlling the exterior lights
const byte CABIN_LIGHTS_PIN = 10; // pin controlling the cabin lights
const byte STORAGE_LIGHTS_PIN = 11; // pin controlling the storage lights
const byte COCKPIT_LIGHTS_PIN = 12; // pin controlling the exterior lights

Note: In past, we used #define to set system-wide variables. Now we’re using const byte.

Const (Constant) – has to remain the same value

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.