Need help with Student Kit

I am trying to learn the Student Kit on my own, and I am having a tough time of it. Some of the lessons are designed to be done in a group, and with a teacher. I have neither. Does anyone have any recommendations for getting the most out of this kit on your own? I want to be able to pass the Arduino exam and have a good understanding of what is going on. Thank you in advance.strong text

Hi,
Please provide more information about this endeavor.
What is "Student Kit"?
Indicate a link about it?

This one?

Yes that is the kit I am talking about.

well, it's been months since I started lesson 5 Holiday lights of the Arduino Student kit. I just can't seem to figure out how to write code on my own, I can make just about any project that is listed if I copy and paste the code it will work. But I really need some sort of tutor that can get me over the hump of putting all the code together. I always seem to get stuck in the same area. Can anyone shine some light on this problem for me?

It takes time, patience and practice practice practice. Have a notebook handy and write down what you learn as you go.

A good book that explains and builds on concepts would be helpful. The below link is a PDF book published in 2012 so the IDE related information can be ignored. There may be something better out there. You may have to break down and buy a good text book from Amazon.

https://www.google.com/url?q=https://nickwinlund.net/~nick/work/ARM/Beginning%2520C%2520For%2520Arduino%2520(2012).pdf&sa=U&ved=2ahUKEwjax8bO0PX8AhWhq4kEHZpYA0EQFnoECAAQAg&usg=AOvVaw2e-m6eVPtmbZjZ8dI2YGZb

Thank you, looks like some really good stuff. But I am the same spot, what do I do when I get stuck.

What are you stuck on?

ther is a lesson where you have to write your own pseudocode and then your own scematic. it is supposed to be done as a group, but I am doing this by myself. So it's time to build your own circuit. That is where I get stuck.

Post the project requirements and what you have done so far and I'll try to be your lab partner. Tell me what you don't understand as we go along.

You won't get graded, it doen't have to be elegant, it doesn't have to be correct the first time. Let's Have Fun with this.

Pseudocode is first. Write down each action that needs to happen in plain English. One pseudocode action line may require 3, 4 or more lines of code to do it. Pseudocode is intended to put your thoughts and code flow on paper.

I recall a flow chart should be first. There is no mention of a flow chart?

Hi,
I can also help, but with details of what you intend to do.
Write a description of the project you intend to build.

I believe 3 makes a quorum. Class is in session. Maybe a few more will stumble in after the bell rings and class gets underway.

While we wait on today's assignment I'm going to jot down a few random thoughts of inspiration.

You have to crawl before you can walk. It took you 6 to 8 months of observation before you could even crawl. It took you even longer before you took that first step. And what a wobbly step it was. Many learned skills come in the same manner. It comes with desire and practice.

Programming is an art. I envy those here that can effortlessly mill out beautiful code. I can't write elegant, tight code anymore than I can paint a masterpiece or write a best selling novel. I can smear paint on canvas, write a B- short story and write functional code but none of it would get the bills paid.

I'm a horrible programmer. I took college level classes in C and Fortran many years ago and I'm still a horrible programmer. I stumble through it until I get it to work. I'm a top-down programmer. I don't consider placing reusable code in functions or using more local variables until I run out of memory and am forced to do so. However, at the end of the day I get it to work. It may not be a pretty baby but it's my baby. And once I upload the final code and close the IDE nobody will ever see my mess. They just see the final result of a working project. My projects impresses my friends and family but my old C++ instructor would grade me a D- on my code.

I mentioned painting. I set up my easel and palette, get my oils in order and get comfortable in front of my blank canvas. I have a basic idea of what I want to create.
The first thing I do is paint a thin background color and let that dry. Then I'll pick up a pencil and lightly draw an outline of what I think I want. I'll resize, reshape and change a few things until these lightly drawn lines somewhat resemble what I envisioned. Mmmm, Pseudocode?

I'm sure you have noticed by now that I do love to write. I find putting thoughts on paper therapeutic. I doubt anyone on this forum minds if I use up some otherwise unused white space while we wait on today's assignment.

1 Like

Where are you located what time zone? I am in the US south Florida. Can we figur out some way to communicate and post pictures and video. This sounds great.

Texas

You can post pictures here. Videos I'm not sure.
Take a pic of the assignment page and post it here using the upload icon (arrow pointing up)

Hi,
I am located in the northeast of Brazil. It's almost the same time zone as Florida.

My specialty was in main frame hardware, which today almost doesn't exist.
For my job I learned to program in a main frame program control CPUs language, something very similar to assembly language.
But then I had to learn C on my own (self study), and I like to program.
I have some difficulties with more complex programming concepts, but I can write and build simpler programs well.

When I said practice practice practice, this is what I do when I have time.
I come to this forum to find posts with problems looking for solutions. If I find something appealing, I take a stab at writing the code. This morning I read this:

I envisioned doing it with map and switch/case. I knew I wanted to use Serial.read and Serial.print so I went to the Arduino Reference page to find an example as a good starting point. I NEVER start with a blank page. No need with so many examples available. It took me a few hours to spit out the below code. lol

There wasn't many replies on that post when I went off to write my code this morning. I came back after a few hours to find all the clever, tight, grade A code others offered. I could never punch out such nice code, but mine works :wink:

On Edit: Actually, mine doesn't work as well as theirs. I have a flaw. Back to the Sketch Board for me

Arduino Reference page is a good place to go if you get stuck
https://www.arduino.cc/reference/en/


// Convert compass heading from degrees 0-360 to String direction

String degreeInput = "";  // string to hold input

void setup() {

  Serial.begin(9600); // Open serial communications and wait for port to open
  while (!Serial) {
    ;
  }
}

void loop() {

  while (Serial.available() > 0)// check for serial input
  {
    int inChar = Serial.read();
    if (isDigit(inChar)) // verifies data entered is a number 0-9
    {
      degreeInput += (char)inChar;  // convert the incoming byte to a char and add it to the string
    }

    if (inChar == '\n') // test for new line terminator
    {

      int degreeInputInt = degreeInput.toInt(); // convert input data string to integer
      if (degreeInputInt > 360) degreeInputInt = 360; // cap input data to 360 degrees to avoid the Opps
      int degreeInputMapped = map(degreeInputInt, 0, 360, 1, 9); // map input data from 0-360 to 1-9 for switch/case

      degreeInput = ""; // clear input data string

      switch (degreeInputMapped) {
        case 1:
          Serial.println("North");
          break;
        case 2:
          Serial.println("North East");
          break;
        case 3:
          Serial.println("East");
          break;
        case 4:
          Serial.println("South East");
          break;
        case 5:
          Serial.println("South");
          break;
        case 6:
          Serial.println("South West");
          break;
        case 7:
          Serial.println("West");
          break;
        case 8:
          Serial.println("North West");
          break;
        case 9:
          Serial.println("North");
          break;
        default:
          Serial.println("Oops");
          break;
      }
    }
  }
}

this is the first mention of pseudocode, lesson 3 traffic lights.
4) So far in this sketch, you’ve written commands to flash the three LEDs connected to your Arduino UNO R3 board. In order to modify these LEDs to act as a traffic light, it’s going to take a bit of thinking. Locate your student logbook and turn to the Lesson 3 page 9.

5) Consider what needs to happen for your circuit to work like a traffic light. In the space provided in your logbook, write pseudocode describing how your traffic light will work. Use standard English. The following questions might help guide you in writing your pseudocode:

  • Should two or more lights ever be on at the same time?
  • Which light should come on first, second, and third?
  • What should the other lights do when one light comes on?
  • What should happen after the third light turns off?
  • How long should each light stay on?

6) Transition your pseudocode to your Lesson 3 sketch in the Arduino IDE. Start by modifying the code you’ve already written. Then add new digitalWrite() and delay() commands as necessary. Here are a few hints as you code:

  • Your void loop() function should have three sections. One for the green light, one for the yellow light, and one for the red light.
  • A delay should separate each section.
  • Not all delays should be the same length.
  • Update your code comments to help you understand each line of code.

7) When you’re finished coding, verify your code and debug as necessary.

8) Upload your code to the Arduino UNO R3 board. When the sketch is completely transferred, the code will execute.

9) Watch the behavior of your traffic light. Does it behave as expected? If not, go back to your sketch and modify your code. Reupload the sketch. Continue to modify the code and reupload the sketch until the traffic light behaves as you described in your pseudocode.

Can you include this sketch? Copy the code and click on the </> icon above

I assume you looked at some pseudocode examples to get an idea what it is?

void setup() {
    // set the LED pins as outputs
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
}
 
void loop() {
    // put your main code here, to run repeatedly:
    
    digitalWrite(3, HIGH); // Turn the green LED on pin 3 ON
    digitalWrite(4, LOW); // Turn the yellow LED on pin 4 OFF
    digitalWrite(5, LOW); // Turn the red LED on pin 5 OFF
    delay(10000);
    digitalWrite(3, LOW); // Turn the green LED on pin 3 OFF
    digitalWrite(4, HIGH); // Turn the yellow LED on pin 4 ON
    digitalWrite(5, LOW); // Turn the red LED on pin 5 OFF
    delay(1000);
    digitalWrite(3, LOW); // Turn the green LED on pin 3 OFF
    digitalWrite(4, LOW); // Turn the yellow LED on pin 4 OFF
    digitalWrite(5, HIGH); // Turn the red LED on pin 5 ON
    delay(10000);
}
void setup() {
    // set the LED pins as outputs
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
}
 
void loop() {
    // put your main code here, to run repeatedly:
    
    digitalWrite(3, HIGH); // Turn the green LED on pin 3 ON
    digitalWrite(4, LOW); // Turn the yellow LED on pin 4 OFF
    digitalWrite(5, LOW); // Turn the red LED on pin 5 OFF
    delay(10000);
    digitalWrite(3, LOW); // Turn the green LED on pin 3 OFF
    digitalWrite(4, HIGH); // Turn the yellow LED on pin 4 ON
    
    delay(1000);
    
    digitalWrite(4, LOW); // Turn the yellow LED on pin 4 OFF
    digitalWrite(5, HIGH); // Turn the red LED on pin 5 ON
    delay(10000);
}