Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Nano Christmas Tree

Status
Not open for further replies.
I would like to program such modules, but I started learning the assembly language for PIC... and only now I realise how easy is to understand (when you have a good tutorial, like the one from MsTracey , but unfortunately the link is not working at all, although the pdf is still downloadable, if you search for PIC tutorials).
 
Hi again Andrei,

It is the C and C++ language. Many of the libraries are in C++, but there are so many examples you just pick out the constructor from that class (given in the example so not much to think about) and once you declare an object of the class it's almost all more like C, unless you want to get more involved with it.

If you have worked with asm you will find this quite a step up with not too much to learn at first.

It's a lot simpler than it sounds too though, and here is an example of the classic "Blink" program that almost everybody tries as their first program:

Code:
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
  This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() { 
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT); 
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);  // wait for a second
  digitalWrite(led, LOW);  // turn the LED off by making the voltage LOW
  delay(1000);  // wait for a second
}

The 'loop' function is called from the main include file which you dont have to be bothered with, and it is called over and over again so it repeats indefinitely until the power is disconnected. The 'setup' function is called only once before the 'loop' function.
 
Hi!
Thanks for your reply!
This program seems very simple... but I feel more comfortable with the assembly for the beginning. I wrote a program for a 16f628 LED flasher using MPLAB, but I havent tested it yet...
 
Hi again,

Oh ok, well good luck with that then. You can also use that for your decorations with LEDs also as i am sure you know. It should work well too. I just wanted to use one of my Nanos for something practical :)
 
Thank you very much!

As for programming a LED sequence... I have seen that is soooo simple. Ex: we use PORTB for controlling 8 leds. All its pins are set to outputs by putting 0000 0000 in TRISB from Bank1 (then we return to Bank0 to manipulate the data). After this we need to place binary values in the PORTB register in order to control the outputs and call a delay subroutine for every step (which makes the result visible for our eyes :D) . But it remains to be programmed...
 
Thank you very much!

As for programming a LED sequence... I have seen that is soooo simple. Ex: we use PORTB for controlling 8 leds. All its pins are set to outputs by putting 0000 0000 in TRISB from Bank1 (then we return to Bank0 to manipulate the data). After this we need to place binary values in the PORTB register in order to control the outputs and call a delay subroutine for every step (which makes the result visible for our eyes :D) . But it remains to be programmed...

Hi,

Yes i agree, and i think you will be able to do this quite easily since you've worked in asm already and know the registers that need to be programmed.
 
This is my RGB LED Christmas tree (it doesn't look really like a Christmas Tree), made out of a piece of transparent plastic sheet, a matrix board, a 3 x AA battery holder, and the brain of my ''design'', a PIC16F628A. I'm sorry because I didn't post it earrlier, but I was a bit busy with the Holiday preparations.
Anyway, this is my little toy in action. Hope you like it!:)
(Ignore the sound of the video, because I forgot the TV turned on while making the video)
 
Some more photos of the toy
PP7D8DV.jpg

IY8j0W5.jpg

LpxEADy.jpg

pSlOHf4.jpg

Lj02bSn.jpg



One more thing to say:
Happy Holidays to everyone!!!!!!!
 
This is my RGB LED Christmas tree (it doesn't look really like a Christmas Tree), made out of a piece of transparent plastic sheet, a matrix board, a 3 x AA battery holder, and the brain of my ''design'', a PIC16F628A. I'm sorry because I didn't post it earrlier, but I was a bit busy with the Holiday preparations.
Anyway, this is my little toy in action. Hope you like it!:)
(Ignore the sound of the video, because I forgot the TV turned on while making the video)

Hi,

Yes that's nice too. I was going for a more traditional look.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top