Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 29, 2014, 09:00:03 pm
Thank you very much.
2  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 22, 2014, 09:44:17 am
I think I tried the if statement before and it scrolls only once. I want the scroll to stay until the PIR goes low. But I'll try it again.
Thanks
3  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 22, 2014, 08:55:50 am
You are an awesome person. Thank you very much and thanks for everyone who provided feedbacks. I cleaned the code and payed attention to everything you guys said.
My code now does what I want it to do. I can stop here if I want but there is one little thing that I wish I can fix: I get stuck in the while loop. It's not a big issue because I can wait for the PIR to go LOW before I push (no problem) but it would be better if I don't have to wait. Someone suggested to use a counter in the loop but I have to change my code and put everything in the loop which means I need to start over again.
I would like if there is another way around this. Thank you very much
here is my current code:
Code:
#include <Keypad.h>
const byte ROWS = 2;
const byte COLS = 2;
char keys[ROWS][COLS] =
{
  {
    '1','3'        }
  ,{
    '7','9'        }
  ,};
byte rowPins [ROWS] = {
  5,6};
byte colPins [COLS] = {
  7,8};
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
const int pirPin = 9;
const int namePin = 13;     
const int offPin = 10;     
const int cvnPin = 11;   
const int vacatPin = 12;   
const int herePin = 2;   
const int latchPin = 3;
const int clockPin = 4;
byte storeKey;
byte key;
int seq[14] = {
  1,2,4,8,16,32,64,128,64,32,16,8,4,2};       
void scrollText(int X, int Y ){
  while(digitalRead(pirPin) == HIGH){
    for (int n = 0; n < 14; n++)
    {
      digitalWrite(latchPin, LOW);             
      shiftOut(X, clockPin, MSBFIRST, seq[n]);         
      digitalWrite(latchPin, HIGH);           
      delay(50);
    }
    for (int n = 0; n < 14; n++)
    {
      digitalWrite(latchPin, LOW);             
      shiftOut(Y, clockPin, MSBFIRST, seq[n]);         
      digitalWrite(latchPin, HIGH);           
      delay(50);
    }
  }

void setup()
{
  Serial.begin (9600);
  pinMode(namePin, OUTPUT);
  pinMode(offPin, OUTPUT);
  pinMode(cvnPin, OUTPUT);
  pinMode(vacatPin, OUTPUT);
  pinMode(herePin, OUTPUT);     
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(pirPin, INPUT);   
}
void loop()
{
  byte key = kpd.getKey();
  if (key)
  storeKey = key;
    switch (storeKey) {
    case '1':
      scrollText(namePin,offPin);
      break;
    case '3':
      scrollText(namePin,cvnPin);
      break;
    case '7':
      scrollText(namePin,vacatPin);
      break;
    case '9':
      scrollText(namePin,herePin);
      break;
    }
}



4  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 14, 2014, 05:26:45 pm
I cleaned my code, however I am stuck in an infinite loop. I tried the if statement in my scrolltext function but the scroll happen only one time. When I use the while loop it get stuck there for ever and pressing another key doesn't do anything. It just keep scrolling at the first one I pressed. Here is my new code.
Code:
#include <Keypad.h>
const byte ROWS = 2;
const byte COLS = 2;
char keys[ROWS][COLS] =
{
  {
    '1','3'      }
  ,{
    '7','9'      }
  ,};
byte rowPins [ROWS] = {
  5,6};
byte colPins [COLS] = {
  7,8};
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
const int pirPin = 9;
const int namePin = 13;     
const int offPin = 10;     
const int cvnPin = 11;   
const int vacatPin = 12;   
const int herePin = 2;   
const int latchPin = 3;
const int clockPin = 4;
int val = 0;
int seq[14] = {
  1,2,4,8,16,32,64,128,64,32,16,8,4,2};       
void scrollText(int X, int Y ){
 val = digitalRead(pirPin);
 Serial.println('val');
  while(val == HIGH){
    for (int n = 0; n < 14; n++)
    {
      digitalWrite(latchPin, LOW);             
      shiftOut(X, clockPin, MSBFIRST, seq[n]);         
      digitalWrite(latchPin, HIGH);           
      delay(50);
    }
    for (int n = 0; n < 14; n++)
    {
      digitalWrite(latchPin, LOW);             
      shiftOut(Y, clockPin, MSBFIRST, seq[n]);         
      digitalWrite(latchPin, HIGH);           
      delay(50);
    }
  }

void setup()
{
  Serial.begin (9600);
  pinMode(namePin, OUTPUT);
  pinMode(offPin, OUTPUT);
  pinMode(cvnPin, OUTPUT);
  pinMode(vacatPin, OUTPUT);
  pinMode(herePin, OUTPUT);     
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(pirPin, INPUT);   
}
void loop()
{
 
  byte key = kpd.getKey();
  if (key)
    switch (key) {
    case '1':
      scrollText(namePin,offPin);
      break;
    case '3':
      scrollText(namePin,cvnPin);
      break;
    case '7':
      scrollText(namePin,vacatPin);
      break;
    case '9':
      scrollText(namePin,herePin);
      break;
    }
}


I hope you give me some suggestions or solution to the problem. Thank you.
5  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 09, 2014, 09:55:26 am
Thank you so much for all these good feedbacks.
Hahaha. I was desperate that's why I chose to crash my car instead of falling from a cliff smiley.
I did change the names to something meaningful.
You are right, the function handlekeypress is only for printing the numbers. It doesn't do anything else.
I will clean my code and try to figure out another way to fix the problem.
Thank you very much
6  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 08, 2014, 04:35:39 pm
I don't know how that function  (i.e. handlekeypress) works. If I removed it, somehow, the keypad doesn't input anything when I press a button.
Thank you for your feedback
7  Using Arduino / Programming Questions / Re: Reset Function is not working in my code on: September 08, 2014, 04:31:04 pm
Answer to the last question. I thought of resetting because when I do it manually on the arduino it allows me to push another button to display another message, if I didn't, pushing another button will not get me out of the loop. If I fixed that I wouldn't need a reset function but after multiple tries, I thought using this software reset will help even though I didn't like it.
8  Using Arduino / Programming Questions / Reset Function is not working in my code on: September 07, 2014, 06:42:12 pm
I am using a reset function in my code but for some reason it’s not resetting my Arduino.
I tested the function with other code and it worked but in this one it didn’t. I tried calling the function in different spot in the code but no results.
This project is using an Arduino Uno, a keypad, shift registers, LEDs, resistors and wires.
I am working on breadboard to test before I put the project together.
Basically the project is like this: when the person pushes a key a message start scrolling if the PIR detected motion if not the Arduino should reset itself through the reset function (which I tested and worked) and the Arduino waits to detect another person or wait for another key to be pushed and display another message (of course if motion is detected)
I hope someone looks at my code and help me find out why the resetFunc() is not working.
Note: I only have one case in the switch. I am trying first to get work with one. The rest should be the same.
            Currently, when I push the Key "1" from the keypad nothing happen until i wave my hand near the PIR which is what I want but it keeps scrolling for ever even if I am not near the PIR.
Thank you.

Code:
#include <Keypad.h>
const byte ROWS = 2;
const byte COLS = 2;
char keys[ROWS][COLS] =
{
  {
    '1','3'    }
  ,
  {
    '7','9'    }
  ,
};

byte rowPins [ROWS] = {
  5,6};
byte colPins [COLS] = {
  7,8};
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


int pirPin = 9;
int dataPin1 = 13;     //Name Pin. Define which pins will be used for the Shift Register control
int dataPin2 = 10;     //Off Pin
int dataPin3 = 11;    //CVN Pin
int dataPin4 = 12;    //Vacation Pin
int dataPin5 = 2;    //Here Pin
int latchPin = 3;
int clockPin = 4;
int val = 0;
int pirState = LOW;
int PirState = PirFun();
int seq[14] = {
  1,2,4,8,16,32,64,128,64,32,16,8,4,2};       //The byte sequence



void setup()
{
  Serial.begin (9600);
  pinMode(dataPin1, OUTPUT);
  pinMode(dataPin2, OUTPUT);
  pinMode(dataPin3, OUTPUT);
  pinMode(dataPin4, OUTPUT);
  pinMode(dataPin5, OUTPUT);     
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(pirPin, INPUT);
}



void handleKeypress (const char key)
{
  Serial.println (key);
}


void(* resetFunc)(void)=0;



boolean PirFun(){
  val = digitalRead(pirPin);
}




void loop()

{

  for (int n = 0; n < 14; n++)
  {
    digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
    shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
    digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
    delay(30);
  }



  byte key = kpd.getKey();
  if (key)
    handleKeypress (key);

  switch (key) {
  case '1':

   
    while(PirState == HIGH){




      for (int n = 0; n < 14; n++)
      {
       
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(10);


      }
      for (int n = 0; n < 14; n++)
      {


        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin2, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(10);


      }
 

    }

    break;

  }

if(PirState == LOW){

        resetFunc();
      }
}
9  Using Arduino / Project Guidance / Re: PIR Sensor Software Issues on: April 28, 2014, 11:35:02 am
Yes I agree with you. It's proper to put it in a separate function, but that's not the problem I have. The code will still work if I fix the PIR issues.
10  Using Arduino / Project Guidance / PIR Sensor Software Issues on: April 27, 2014, 06:14:17 pm
Hi,
  I am using a pir (3 pin PIR) in my project and somehow the PIR is not responding. It doesn't detect motion. I tried the PIR with a simple code that turns an LED when motion is detected and it worked fine on the same pin i am using (i.e. Pin 9) however when I upload the code below the pir doesn't work. I hope someone could help me figure out the problem. I think the issue is purely software issue.
Code:

Code:
#include <Keypad.h>
const byte ROWS = 2;
const byte COLS = 2;
char keys[ROWS][COLS] =
{
  {
    '1','3'  }
  ,
  {
    '7','9'  }
  ,
};

byte rowPins [ROWS] = {
  5,6};
byte colPins [COLS] = {
  7,8};
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


int pirPin = 9;
int dataPin1 = 13;     //Name Pin. Define which pins will be used for the Shift Register control
int dataPin2 = 10;     //Off Pin
int dataPin3 = 11;    //CVN Pin
int dataPin4 = 12;    //Vacation Pin
int dataPin5 = 2;    //Here Pin
int latchPin = 3;
int clockPin = 4;
int val = 0;

int seq[14] = {
  1,2,4,8,16,32,64,128,64,32,16,8,4,2};       //The byte sequence



void setup()
{
  Serial.begin (9600);
  pinMode(dataPin1, OUTPUT);
  pinMode(dataPin2, OUTPUT);
  pinMode(dataPin3, OUTPUT);
  pinMode(dataPin4, OUTPUT);
  pinMode(dataPin5, OUTPUT);    
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(pirPin, INPUT);
}




void handleKeypress (const char key)
{
  Serial.println (key);
}



void loop()

{

  for (int n = 0; n < 14; n++)
  {
    digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
    shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
    digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
    delay(20);
  }


  byte key = kpd.getKey();
  if (key)
    handleKeypress (key);

  val = digitalRead(pirPin);

  switch (key) {
  case '1':
//  Serial.println("entering loop");
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin2, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }
//Serial.println("exiting loop");
    break;
Serial.println("after break");
  case '3':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin3, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  case '7':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin4, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  case '9':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin5, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  }

}


Here is the code that I am using for the PIR you can find it scattered in the code above. I just copied it here below so you see what I am doing:

Code:

Code:
int pirPin = 9;
int val = 0;
pinMode(pirPin, INPUT);
val = digitalRead(pirPin);
 while(HIGH == val)


Thank you very much

Moderator edit: [code] [/code] tags added.
11  Using Arduino / Project Guidance / PIR Doesn't Respond on: April 24, 2014, 12:30:22 pm
Hi,
  I am using a pir (3 pin PIR) in my project and somehow the PIR is not responding. It doesn't detect motion. I tried the PIR with a simple code that turns an LED when motion is detected and it worked fine on the same pin i am using (i.e. Pin 9) however when I upload the code below the pir doesn't work. I hope someone could help me figure out the problem. I think the issue is purely software issue.
Code:
#include <Keypad.h>
const byte ROWS = 2;
const byte COLS = 2;
char keys[ROWS][COLS] =
{
  {
    '1','3'  }
  ,
  {
    '7','9'  }
  ,
};

byte rowPins [ROWS] = {
  5,6};
byte colPins [COLS] = {
  7,8};
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


int pirPin = 9;
int dataPin1 = 13;     //Name Pin. Define which pins will be used for the Shift Register control
int dataPin2 = 10;     //Off Pin
int dataPin3 = 11;    //CVN Pin
int dataPin4 = 12;    //Vacation Pin
int dataPin5 = 2;    //Here Pin
int latchPin = 3;
int clockPin = 4;
int val = 0;

int seq[14] = {
  1,2,4,8,16,32,64,128,64,32,16,8,4,2};       //The byte sequence



void setup()
{
  Serial.begin (9600);
  pinMode(dataPin1, OUTPUT);
  pinMode(dataPin2, OUTPUT);
  pinMode(dataPin3, OUTPUT);
  pinMode(dataPin4, OUTPUT);
  pinMode(dataPin5, OUTPUT);     
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(pirPin, INPUT);
}




void handleKeypress (const char key)
{
  Serial.println (key);
}



void loop()

{

  for (int n = 0; n < 14; n++)
  {
    digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
    shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
    digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
    delay(20);
  }


  byte key = kpd.getKey();
  if (key)
    handleKeypress (key);

  val = digitalRead(pirPin);

  switch (key) {
  case '1':
//  Serial.println("entering loop");
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin2, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }
//Serial.println("exiting loop");
    break;
Serial.println("after break");
  case '3':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin3, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  case '7':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin4, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  case '9':
    while(HIGH == val)
    {
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin1, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(20);
      }
      for (int n = 0; n < 14; n++)
      {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin5, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(50);
      }

    }


    break;

  }

}

Here is the code that I am using for the PIR you can find it scattered in the code above. I just copied it here below so you see what I am doing:

Code:
int pirPin = 9;
int val = 0;
pinMode(pirPin, INPUT);
val = digitalRead(pirPin);
 while(HIGH == val)

Thank you very much
12  Development / Other Software Development / expected unqualified-id before if on: March 24, 2014, 12:39:43 am
I am trying to use a keypad to take the input of one key to turn a sepicific pin on. I have a total of 4 inputs, so when the person press the right button it will turn the right pin. The issue I am having is: I get "expected unqualified-id before if " . I used the switch and got the same issue. Do you know what I am doing wrong?
Here is the code that I am running:
Code:
#include <Keypad.h>
int pirPin = 8;
int NamePin = 9;
int HerePin =10;
int CvnPin = 2;
int OffPin = 11;
const byte ROWS = 3;
const byte COLS = 3;
char keys[ROWS][COLS] =
{
  {
    '1','2','3'     }
  ,
  {
    '4','5','6'     }
  ,
  {
    '7','8','9'     }
  ,

};
byte rowPins [ROWS] = {
  5, 4, 3};
byte colPins [COLS] = {
  8, 7, 6 };
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()
{
  Serial.begin (9600);   
  pinMode(NamePin, OUTPUT);
  pinMode(HerePin, INPUT);   
  pinMode(CvnPin, OUTPUT);
  pinMode(OffPin, INPUT);

void handleKeypress (const char key)
{
  Serial.println (key);
}
if(key == '1')
{
  digitalWrite(NamePin, LOW);
  delay(1000);
  digitalWrite(NamePin, HIGH);
  delay(1000);

else if (key = '3')
digitalWrite(NamePin, LOW);
delay(1000);
digitalWrite(HerePin, HIGH);
delay(1000);
else if (key = '7')
digitalWrite(NamePin, LOW);
delay(1000);
digitalWrite(CvnPin, HIGH);
delay(1000);
else (key = '9')
digitalWrite(NamePin, LOW);
delay(1000);
digitalWrite(OffPin, HIGH);
delay(1000);
}
void loop()
{
  byte key = kpd.getKey();
  if (key)
    handleKeypress (key);
}
13  Development / Other Software Development / Re: Standalone on: March 14, 2014, 10:49:30 am
I live in USA. I think I'll try buying from Sparkfun this time. they are familiar to me.
Thank you for your help
14  Development / Other Software Development / Re: Standalone on: March 14, 2014, 01:36:20 am
First, thank you very much for getting back to me.
I performed the test you suggested. here is the outcome:
1- I don't think I still have the original ATMEGA328 that came with the Arduino. I bought the arduino 3 years ago and later I bought 10 ATMEGA328Ps to use in  projects that I may think about; then I stopped for a while and now I wanted to go back to Arduino, so I am not sure if I still have the original or not but I know that I used these 328 before in other circuits and worked fine. I guess I need to go back and try them again.
2- As I mentioned in a previous message I use the Arduino IDE to upload the code to the ATMEGA328P. When the upload is completed I get a message on the IDE that the upload is completed, if not it spits some errors.
3-When I uploaded your code I saw that LED near pin 13 on the Arduino blinking at a rate of 5HZ (approx.) I also opened the serial monitor to see the message and got "Hello from Arduino"
4- I pressed the reset button that is near the USB plug on the Arduino to see what will happen and didn't notice any changes except that every time you hit reset the serial monitor prints the message, the LED blinking rate was the same.
5- However when I unplug and plug the USB (Recycle power) the sketch got lost. I had to upload it to get it back to normal.
That's what I observed.
Now you made me think that maybe these 328s is the problem. I hope so.
Can you suggest a place where I can get a good 328 ; also could tell me what to look for when you buy these little devices. Thank you again. Thank you.
 
15  Development / Other Software Development / Re: Standalone on: March 13, 2014, 01:50:24 am
I am, basically, trying to implement the first example (using one shift register). The example can be seen here:
http://arduino.cc/en/tutorial/ShiftOut#.UyFRC4VRHKd
The purpose is to use it for a scroll sign but before I get there. I wanted to get the basics first.
The final project will be like this: I will use a range finder or another mention sensor and when triggered it will cause a message to scroll.
for now I just wanted to be able to get that first example working without loosing the sketch when I recycle power.
I got the 328s a while ago. I remember the seller told me they have a boot-loader installed in them and should work just like the one you buy with the Arduino.
You raised a good question. I don't know what a bootloader does and are there different bootloaders?
Thank you very much for your help.
Pages: [1] 2 3 ... 5