Show Posts
Pages: [1]
1  Topics / Interactive Art / Re: myFirstProject on: April 10, 2013, 09:53:46 am
The kitscan is just for fun, but it also proves my resistors and leds are firmly in the breadboard.
2  Development / Other Software Development / Re: CodeBlocks Arduino IDE - real C++ IDE for Arduino development (rev.20130401) on: March 31, 2013, 02:26:39 pm
Hi, newbie here, sorry about my lack of knowledge

Why is code::blocks reporting warnings on files like malloc.c, print.cpp & tone.cpp when I'm trying to build the default 'blink' sketch?

I use Revision 20130401 on a Windows 7 x64 box and a mega1280. Standard arduino ide works without problems.

Thanks for making this! I'm looking forward to using it!.

regards,

Bert

3  Topics / Interactive Art / myFirstProject on: March 17, 2013, 03:16:35 pm
Hi all,

I got my first arduino over a month ago and already learned a lot. Today I succeeded in getting 8 leds randomly blinking for a certain amount of time after triggering it with a pir sensor.

No rocket science nor brain surgery but I'm a happy camper for sure!

Code below, I'm sure it can be done better in less code but I'm proud of it! Thanks to you all for providing the vast amount of information, examples and inspiration

Code:
/*
pir sensor set to retrigger
and shortest delay time

blink runtime is loopSpeed / 1000 * upTime

*/

// init
int ledPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
int ledState[] = {0, 0, 0, 0, 0, 0, 0, 0};
int pinCount = 8;
int loopSpeed = 500;
int upTime = 20;
int randNumber;

int pirPin = 3;
int pirState = LOW;
int val = 0;

// setup
void setup(){
  for(int thisPin = 0; thisPin < pinCount; thisPin++){
    pinMode(ledPins[thisPin], OUTPUT);
    randomSeed(analogRead(0));
  }
  //test all leds with a kit-scan
  for(int thisPin = 0; thisPin < pinCount; thisPin++){
    digitalWrite(ledPins[thisPin], HIGH);
    delay(100);
  }
  for(int thisPin = 0; thisPin < pinCount; thisPin++){
    digitalWrite(ledPins[thisPin], LOW);
    delay(100);
  }
  for(int thisPin = pinCount-1; thisPin >=0; thisPin--){
    digitalWrite(ledPins[thisPin], HIGH);
    delay(100);
  }
  for(int thisPin = pinCount-1; thisPin >=0; thisPin--){
    digitalWrite(ledPins[thisPin], LOW);
    delay(100);
  }
delay(1000); 
}

void loop(){
  val = digitalRead(pirPin);
  if (val == HIGH){
    for (int counter = 0; counter <= upTime; counter++){
      randNumber = random(pinCount);
      if (ledState[randNumber] == 0){
        ledOn();
      }
      else{
        ledOff();
      }
      delay(loopSpeed);
    }
  }
  else {
    for(int thisPin = 0; thisPin < pinCount;  thisPin++){
      digitalWrite(ledPins[thisPin], LOW);
      digitalWrite(ledState[thisPin], 0);
      delay(loopSpeed);
    }
  }
}


void ledOn(){
  digitalWrite(ledPins[randNumber], HIGH);
  ledState[randNumber] = 1;
}


void ledOff(){
  digitalWrite(ledPins[randNumber], LOW);
  ledState[randNumber] = 0;
}

regards, Bert(uino)
4  Using Arduino / Project Guidance / Re: Tutorial for hacking a CP2102 USB from ebay and uploading a sketch to an Atmega on: February 03, 2013, 11:01:38 am
Quote
That one in the ebay link looks a bit different than the one the guys are hacking...Does this one also require hacking?
Yes, but it may be very difficult to hack as I don't see a DTR signal pad to attach to. The DTR signal is avalibe on the CP2101 chip, but it's very difficult to solder anything to those small spaced chip pins. Doesn't mean it can't be used but you may not be able to get it to utilize the auto-reset function and will have to use a well timed manual push button reset on the arduino board prior/during uploading.

Lefty

first post here, just to mention i just succeeded to upload sketch using a cp2101 and a rbbb after having read about the 'well timed manual reset'

Thanks!

61bert
Pages: [1]