Most of what I have learned is from that dude from toptechboy.com and random tutorials online. I guess the overload of info online makes it hard to choose something as a guide because some of the tutorials I found online were terrible. The terrible tutorials were designed in a way where you didn't really learn anything (at least with myself) or couldn't add on to what you already know. "Don't worry if you don't understand everything right now" is what I keep reading/hearing in these tutorials.
These are some of the examples of what I know and they just feel memorized and not fully understood. (Like I understand 25% of what is going on).
LED and Button
int ledPin = 3;
int buttonPin = 2;
void setup() {
pinMode(ledPin,OUTPUT);
pinMode(buttonPin,INPUT_PULLUP);
}
void loop() {
int buttonState = digitalRead(buttonPin);
digitalWrite(ledPin,buttonState);
}
serial port printing w/led's
int redLedPin = 9;
int redOnTime = 250;
int redOffTime = 250;
int yellowLedPin = 10;
int yellowOnTime = 250;
int yellowOffTime = 250;
int numRedBlink = 5;
int numYellowBlink = 5;
void setup() {
Serial.begin(9600);
pinMode(redLedPin, OUTPUT);
pinMode(yellowLedPin, OUTPUT);
}
void loop() {
Serial.println("the Red LED is blinking");
for (int j = 1; j <= numRedBlink; j = j + 1) {
Serial.print(" You are blink #: ");
Serial.println(j);
digitalWrite(redLedPin, HIGH);
delay(redOnTime);
digitalWrite(redLedPin, LOW);
delay(redOffTime);
}
Serial.println(" ");
Serial.println("the Yellow LED is blinking");
for (int j = 1; j <= numYellowBlink; j = j + 1) {
Serial.print(" You are blink #: ");
Serial.println(j);
digitalWrite(yellowLedPin, HIGH);
delay(yellowOnTime);
digitalWrite(yellowLedPin, LOW);
delay(yellowOffTime);
}
Serial.println(" ");
}
These are just two examples. I have physically written down every program (around 15) I have done so that I can recreate them by memory or lack of memory. Basically, building upon the basic blink example and expanding on it is what I have done. Maybe this approach is just stupid because I don't really understand what is actually going on, lol. Confusion with where you can and can't use integers, variables, statements, what can and can't be an OUTPUT/INPUT, global variables, for loops, etc... it is all so confusing. The "don't be worried if you don't understand everything right away" phrase is what I keep emphasizing to myself. Thinking that through all of the confusion it will eventually "click". Nothing has clicked yet, lol. A buddy of mine who works in IT says I am technologically retarded, lol. I think he is right. Always 10 years behind the times it seems.
Adding // or /* comments is something I did for a while but stopped because this is a hobby for me not a profession. Not meaning that I don't take it seriously. Thanks frackers, the importance of comments is something that I have ignored. Building a digital clock, dusk to dawn solar powered light, intrusion alarm, flashlight, weather station, rfid or I guess it would be a gps tag for my dog, etc.. are all things I would love to do before I die because it seems fun (although frustrating) to do.