Pages: [1]   Go Down
Author Topic: can someone help me writing the matlab code for this arduino program ? Please  (Read 359 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

int ledCount = 3;
int ledPins[] = {  11, 12, 13 };
int ledDelay = 1000;

void setup() {
  for (int thisLed = 0; thisLed < ledCount; thisLed++) {
    pinMode(ledPins[thisLed], OUTPUT);
  }
}

void loop() {
  for (int thisLed = 0; thisLed < ledCount-1; thisLed++) {
    digitalWrite(ledPins[thisLed], HIGH);
    delay(ledDelay);
    digitalWrite(ledPins[thisLed], LOW);
  }
  for (int thisLed = ledCount-1; thisLed > 0; thisLed--) {
    digitalWrite(ledPins[thisLed], HIGH);
    delay(ledDelay);
    digitalWrite(ledPins[thisLed], LOW);
  }
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24284
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try here
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need the code please help me
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24284
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You posted "the code" (badly, but you can go back and correct it) in your original post.
What are you asking for?
Should this be in the "Interfacing" section, or in "Gigs and collaborations"?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i wanna contol my LEDs in the arduino board through matlab. now what should i post and where ?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 547
Posts: 45972
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
now what should i post and where ?
It sounds like you should be posting an offer to pay someone to write code for you, in Gigs and collaboration. Here, we're willing to help you understand the issues well enough to write the code yourself. But, it sounds like you have no clue about matlab and no interest in getting such a clue.
Logged

Pages: [1]   Go Up
Jump to: