https://www.reddit.com/r/funny/comments/5auld0/elon_musk_looking_like_a_fat_cat/
"The most commonly preferred language used to develop the drivers and OS / Kernel is Embedded C with XML . "
Sensors convert various forms of physical energy into electrical energy, allowing microcontrollers to read changes in the physical world.
void setup() {// declare pin 2 to be an input:pinMode(2, INPUT);declare pin 3 to be an output:pinMode(3, OUTPUT);}void loop() {// read pin 2:if (digitalRead(2) == 1) {// if pin 2 is HIGH, set pin 3 HIGH:digitalWrite(3, HIGH);} else {// if pin 2 is LOW, set pin 3 LOW:digitalWrite(3, LOW);}
You can dim an LED with the same circuit as you used for digital output. Just use analogWrite() on the pin to which the LED is connected.