Show Posts
Pages: [1] 2
1  Topics / Robotics / Re: BBC Turtle Clone? on: July 13, 2013, 08:03:02 pm
The pen setup would have to be the first thing installed.  Everything else would be built around it.
2  Topics / Robotics / Re: BBC Turtle Clone? on: July 13, 2013, 05:33:40 pm
So I have been browsing around and researching my options.  I think CrossRoads was correct about using the Pololu 3pi style robot for this project.  For it to work just like the original Turtle, the pen will have to be dead centre and the robot will have to rotate exactly around that point.  Ultimately I think I would enjoy designing the robot's chasis and specs.  So I'm thinking about getting a kit robot to test ideas and learn what I need in the final design.

What do you guys think about these ultra-cheap kits from China:

http://www.ebay.co.uk/itm/171056734576 ?

I'm thinking for testing it will work out fine.  Or should I double my money and go for something like this:

http://www.ebay.co.uk/itm/130936585418

Views welcome
3  Topics / Robotics / Re: BBC Turtle Clone? on: July 12, 2013, 12:57:40 pm
Hey

Thanks guys.  This is the germ of an idea in my mind, but I very much appreciate the code examples.  I'm very new to coding myself and agree about uncommented sketches.  It took me days working about a very simple shift register example that was included with the library!

Still, I'll spend some time planning out the hardware.
4  Topics / Robotics / BBC Turtle Clone? on: July 12, 2013, 08:11:31 am
Hi Guys

Many years ago when I was at school, we were taught to use a robot that used a pen to draw geometric shapes on paper.  It was programmed using a BBC Micro computer and the robot was called Turtle (as that's what it resembled).

I would like to create a similar robot for my daughter that has the same or similar programming language.  It was almost like BASIC where simple scripts could be written and sent to the robot.  Such as

Code:
PD
FD 120
LT 90
FD 120
PD
FD 120
LT 90
FD 120
PU
HOME

Would draw a square.

I have tried googling around but am finding surprisingly little on it.  It seems like the sort of thing that someone would have made with the arduino.  However, I see no obvious example.  There are a lot of drawing robots that seem to be more about artistic drawing, rather than designed to teach very basic 'programming' commands.

So has anyone come across a project like this?  The robot is simple enough to build.  But I would rather not spend time developing the scripting side of things if someone has already done it. 

Would appreciate your views.
5  Using Arduino / LEDs and Multiplexing / Re: Using Ethernet cables & connectors for wiring LEDs? on: July 11, 2013, 06:03:30 am
So I've been thinking about this and searching through one of the large electrical catalogues.  Seems like there is no perfect solution to this.  I'm now thinking about using Parallel Printer Cables.  They are 50 way and low cost.  It will be much less cables than using ethernet and the wires should be a bit bigger in diameter.  The only problem I can forsee is working out which cable goes to what pin.  But I guess a multimeter will solve that problem.
6  Using Arduino / LEDs and Multiplexing / Re: Using Ethernet cables & connectors for wiring LEDs? on: July 10, 2013, 03:11:29 pm
Thanks guys.  I'll have a play
7  Using Arduino / LEDs and Multiplexing / Re: Using Ethernet cables & connectors for wiring LEDs? on: July 10, 2013, 02:45:55 pm
Hi

The LEDs will be going through TLC5940 LED Drivers.  All the grounds will be tied together. So I assume I can have a single ground connector for all of the LEDs?
8  Using Arduino / LEDs and Multiplexing / Using Ethernet cables & connectors for wiring LEDs? on: July 10, 2013, 02:30:53 pm
Hi Guys

I am designing a light fixture for a room that will hold 128 LEDs.  I want an easy way to connect the control board to the LEDs.  Would it be ok to use a Cat6 cable for this?  It would still be a hell of a lot of cables, but a little neater than using crimp connectors?

Any help appreciated.

Many thanks

Tom
9  Using Arduino / LEDs and Multiplexing / Re: LED Star field TLC5940 Coding Issues (newb) on: July 09, 2013, 04:53:11 pm
Thanks Guys.  I have managed to get it working using this code:

Code:
#include "Tlc5940.h"
#include "tlc_fades.h"
TLC_CHANNEL_TYPE channel;

int l;

void setup()
{
  Tlc.init();
  randomSeed(analogRead(0));
}

void randomled()
{
  if (tlc_fadeBufferSize < TLC_FADE_BUFFER_LENGTH - 14) {
    if (!tlc_isFading(channel)) {
      uint16_t duration = analogRead(0) * 8;

      uint32_t startMillis = millis() + 70;
      uint32_t endMillis = startMillis + duration;
      tlc_addFade(l, 33, 4096, startMillis, endMillis);          // fade in
      tlc_addFade(l, 4096, 33, endMillis, endMillis + duration); // fade out
    }
    if (l++ == NUM_TLCS * 16) {
      l = 0;
    }
  }
  tlc_updateFades();
}

void loop()
{
l = random(0,16);
randomled();
}

I'm still not 100% sure on exactly how it works, but it seems to replicate 'Twinkling Stars'.  The next step is to add another TLC5940 and another 16 LEDs and see how it works.
10  Using Arduino / LEDs and Multiplexing / Re: LED Star field TLC5940 Coding Issues (newb) on: July 09, 2013, 02:17:48 pm
Hi, thanks.  But I think you over estimate my abilities.  My knowledge of code is lacking.  My code examples are hacked together from examples in the TLC5940 examples. 

At any rate, the randomseed function is not the problem.  I can't work out how to combine the two functions to achieve my goal.
11  Using Arduino / LEDs and Multiplexing / Re: LED Star field TLC5940 Coding Issues (newb) on: July 09, 2013, 01:04:36 pm
Hi

I appreciate your help on this.  However, I can't seem to get what I need.  The fades demo that comes with the TLC5940 library works, but does not give me the kind of 'randomness' that I need.  It appears it is designed to 'pulse' in a certain direction.  I could achieve what I wanted by physically wiring the leds in a random fashion.  But I feel like I should be working out exactly how to get each LED to fade on and off at random intervals.  Below is the code I am working on.  'randomled' is the correct random display of LEDs and 'fadeleds' gives me the right 'breath' action.  But I can't seem to work out how to combine the 2 actions.

Code:
#include "Tlc5940.h"
#include "tlc_fades.h"
TLC_CHANNEL_TYPE channel;
void setup()
{
 /* Call Tlc.init() to setup the tlc.
 You can optionally pass an initial PWM value
 (0 - 4095) for all channels.*/
 Tlc.init();
}

void fadeleds()
{
  if (tlc_fadeBufferSize < TLC_FADE_BUFFER_LENGTH - 4) {
    if (!tlc_isFading(channel)) {
      uint16_t duration = analogRead(0) * 4;
      int maxValue = analogRead(0) * 4;
      uint32_t startMillis = millis() + 50;
      uint32_t endMillis = startMillis + duration;
      tlc_addFade(channel, 0, maxValue, startMillis, endMillis);
      tlc_addFade(channel, maxValue, 0, endMillis, endMillis + duration);
    }
    if (channel++ == NUM_TLCS * 16) {
      channel = 0;
    }
  }
  tlc_updateFades();
}

void randomled(int m)
// displays random LEDs for m times
{
 randomSeed(analogRead(0));
 for (int qq=0; qq<m; qq++)
 {
 Tlc.clear();
 Tlc.set(random(16), 3895);
 while(Tlc.update());
 delay(500);
 }
}

void loop()
{

 
 
 
}

I've been staring at this for hours.  There must be a simple way to get the random command to trigger the fade action.  I think it is because I do not fully understand how the fade code works.
12  Using Arduino / LEDs and Multiplexing / Re: LED Star field TLC5940 Coding Issues (newb) on: July 09, 2013, 08:00:26 am
Hey

So based on your replies, I decided to look at the wiring.  Instead of troubleshooting each connection, I stripped it all off the breadboard and rewired from scratch.  I can now confirm that it is working correctly and each individual LED is lighting instead of in pairs.

Thanks for your help...

So now on to the 2nd part of my question. How do I make the LEDs 'breath' when they are lit, instead of just turn on and off? 

The ultimate goal here is to make a very large star field installation on a ceiling, using over 100 LEDs
13  Using Arduino / LEDs and Multiplexing / Re: LED Star field TLC5940 Coding Issues (newb) on: July 08, 2013, 03:44:44 pm
Hi

Thanks for taking the time to reply.  However, I'm still not clear on how to proceed.  I've changed code to include the while statement around  Tlc.update();  It compiles and uploads, but does not change anything.  I'm still not clear why it's lighting 2 LEDs at once and then how to make them randomly 'breath' instead of just flash.

Thanks
14  Using Arduino / LEDs and Multiplexing / LED Star field TLC5940 Coding Issues (newb) on: July 07, 2013, 05:18:57 pm
Hi Guys

I am working towards making a star-field ceiling installation, using white LEDS and TLC5940 LED Drivers

I've breadboarded one chip with 16 leds to get an idea of how it will all go together and work out the code.  I'm getting some weird results and I'm also very new to programming, so the code is confusing me a bit.

I've used alternating blue and white LEDs to make it easier to see what's going on. I'm feeding it 7.5v through the arduino's ext power.  This is how it's wired:



I have been playing around with example sketches and have hacked together the following sketch using the tlc5940 arduino library...

Code:
#include "Tlc5940.h"
void setup()
{
 /* Call Tlc.init() to setup the tlc.
 You can optionally pass an initial PWM value
 (0 - 4095) for all channels.*/
 Tlc.init();
}

void randomled(int m)
// displays random LEDs for m times
{
 randomSeed(analogRead(0));
 for (int qq=0; qq<m; qq++)
 {
 Tlc.clear();
 Tlc.set(random(16), 1095);
 Tlc.update();
 delay(200);
 }
}

void loop()
{
 randomled(100);
}

This works to a degree, but oddly it lights up a blue & white led together at the same time.  So it's like the code is treating every 2 leds as a pair and turning them on together.  This happens at random intervals, as it should, but always shows the 2 leds next to each other each time.  A video might explain better:



So apart from working out why it's lighting the LEDs in pairs, I also need to make the whole thing look like twinkling stars.  I thought the 'Breathing' routine would work best.  However, being new to programming, I just don't know where to start.  There are examples of the breathing routine out there, but I can't work out how to get each random LED to 'breath' on and off.  The whole installation will use around 128 LEDs and I'm thinking, to make it look more 'natural', it will need to light more than one LED at a time.  So would I just have, say, 4 separate circuits?  all running at the same time.  This way there would be an overlap in LEDs that are on/off.

Hope some of this makes sense.  I do want to learn this stuff for myself, so happy to get pointers in the right direction.  If I need to give any more info, let me know.
15  Using Arduino / Programming Questions / Re: Stepper Moves, IR Flashes, Repeat... How? on: March 23, 2013, 03:48:44 pm
Hi Ian

Sorry for the long delay in replying.  I went abroad for a bit on business and have just been too busy to look at this.  Until today. 

I went over it all again and still could not get it to work.  I stripped everything off the breadboard and started again.  Still nothing.  I then tried using a different pin for the button and using the resistor to pull it down to ground.  This, I'm glad to say, worked.  The whole thing is now working exactly how I wanted.  Thanks for all your help on this

Quick question for fun.  I would like to add something that stops you from pressing the button while it's running.  i.e at the moment if you press it and then press it again, it will reset while running the loop.  Also it might be good to have a cancel button to break out of the loop and reset.

Can I get some clues how to do this?
Pages: [1] 2