0 Replies - 356 Views - Last Post: 15 September 2013 - 01:29 PM Rate Topic: -----

#1 Admiral Awesome  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 19
  • Joined: 09-September 13

Tips on beginner use of the FRDM-KL25Z Micro controller (Freescale)

Posted 15 September 2013 - 01:29 PM

well it seems hard to keep control of a broad topic so I guess I'll start asking many smaller, specific topics for now on.

To start off, here's the product page of my Micro controller:

FRDM-KL25Z


So this is my first Micro Controller, and I'm fairly new to this whole field, the most I have is some basic knowledge of C. In an effort to figure this out on my own, I have found how to set up the Micro controller, and start programming it using the web compiler. I found an example of the Hello World program to make the LED light blink, and using the C I know, I'm made loops and such to make the three different color lights (blue, green and red) blink at different intervals, I guess making a sort of light show if anything.

So I pretty much went with this code:

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}



and ended up messing around to make this:

#include "mbed.h"

DigitalOut myled(LED1);         //giving variables to all 3 lights to be used in main
DigitalOut myled2(LED2);        //LED1 = blue, LED2 = green, LED3 = red
DigitalOut myled3(LED3);


int main() {        //main function that starts off the program


    while(1) {      //while loop that is set to true so that it will repeat indefinitely
    
        
        
        
        myled = 1;      //controls the blinking pattern for the blue LED
        wait(0.2);
        myled = 0;
        wait(0.2);        
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        
        
        
        myled2 = 1;     //controls the blinking pattern for the green LED
        wait(0.1);
        myled2 = 0;
        wait(0.1);
        myled2 = 1;
        wait(0.2);
        myled2 = 0;
        wait(0.5);
        myled2 = 1;
        wait(0.5);
        myled2 = 0;
        wait(0.2);
        
        
        
        myled3 = 1;     //controls the blinking patter for the red LED
        wait(0.2);
        myled3 = 0;
        wait(0.2);
        myled3 = 1;
        wait(1);
        myled3 = 0;
        wait(1);
        myled3 = 1;
        wait(0.5);
        myled3 = 0;
        wait(0.5);
    }
}


It's nothing much, but still enough for me to be proud of. I apologize for all the comments, being as new as I am, it helps me to understand if I make sure to comment every little thing.


My question now however, is I have no idea what else I can do with a Micro controller, is there a specific topic that I should move onto next after this? I don't see too much more I can do with just a blinking LED light, and I know micro controllers are used for interactions with almost any electronic. I'm guessing I'm eventually supposed to plug things into this Micro controller and transfer commands through it, but is that the next step?

I would like to express that I'm not asking for tutoring or want someone to give me all their resources on the subject, simply the name of another function is more than enough for me to start searching. I tried to use the Mbed site information, but it more or less jumps from it's "Hello World" code into topics that didn't seem to go in an efficient learning curve and was much too difficult.

Maybe it's only because I'm starting, but it seems there's so many branches to Micro Controllers, and different uses of them, that I jumped into a sea of information and don't know which to swim to find shallow water.

Thanks in advance for any and all information and help.

Is This A Good Question/Topic? 1
  • +

Page 1 of 1