Show Posts
Pages: 1 2 3 [4] 5 6 ... 34
46  Using Arduino / Project Guidance / Re: 2x3-pin header source on: May 30, 2014, 06:38:44 pm
Is it something like is?

http://www.mouser.com/3M/Connectors/Headers-Wire-Housings/_/N-ay0loZscv7?P=1z0zp4dZ1z0wxp6Z1z0x3z4Z1z0wxnw&FS=True
47  Using Arduino / Project Guidance / Re: Arduino for extensive Image processing and suitable camera. on: May 28, 2014, 10:38:41 am
Or using this Intel Galileo with 256MBytes DRAM
http://arduino.cc/en/ArduinoCertified/IntelGalileo
48  Using Arduino / Project Guidance / Re: Arduino for extensive Image processing and suitable camera. on: May 28, 2014, 10:22:50 am
With Atmel’s AT90S8515 microcontroller and a black-and-white digital camera with a resolution of 123 x 128 pixels, operating at a rate of one to 30 frames per second.
http://www.atmel.com/images/issue4_pg39_43_robotics.pdf
49  Using Arduino / Project Guidance / Re: Help with sampling using analog port (noise from finger) on: May 28, 2014, 08:22:58 am
http://arduino.cc/en/Tutorial/PWM
http://playground.arduino.cc/Code/PwmFrequency
4)   Repeat measurement with input from static  voltage from analog output (PWM)

Maybe there is something I do not understand? How do i go about doing this?
Make one of the pin output PWM and connect analog port to that pin.

50  Using Arduino / Project Guidance / Re: Arduino Onboard Battery on: May 28, 2014, 05:51:02 am
Otherwise, could you suggest a similar product that might do the trick.
https://learn.adafruit.com/li-ion-and-lipoly-batteries?view=all


https://www.sparkfun.com/products/10711


http://www.seeedstudio.com/wiki/Energy_Shield


http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2127566_-1
51  Using Arduino / Project Guidance / Re: Recomended book to learn programming arduino on: May 27, 2014, 07:42:09 am
Some resource for you to learn programming arduino

http://playground.arduino.cc/Main/TutorialList

http://forum.arduino.cc/index.php?topic=1539.0
52  Using Arduino / Project Guidance / Re: Battery monitor on: May 27, 2014, 07:27:35 am
Using this
Step-Up/Step-Down Voltage Regulators
Buck-boost and SEPIC converters work with input voltages that are higher than, equal to, or lower than the regulated output voltage, making them especially well-suited for battery-powered applications in which the battery voltage begins above the desired output voltage and drops below the target as the battery discharges.

Will enable you to have constant voltage for your Arduino Uno.
53  Using Arduino / Project Guidance / Re: Urgent beginner Question, please help.. on: May 25, 2014, 08:40:16 pm
Can I ask if the relay = transistor ? Sorry I am a noob on electronics, I know more about fluid mechanics..
These are relays

This is the circuit that transistor control the relay

These are Transistors



54  Using Arduino / Project Guidance / Re: Urgent beginner Question, please help.. on: May 25, 2014, 07:05:47 pm
How you control the "3/2-way solenoid valve"? by DC voltage(DC12V /24V) or AC voltage?(AC 110V/230V) how much current?
Please provide datasheet for the solenoid valve.

Be it DC or AC, you can use relay to control them.

http://playground.arduino.cc/uploads/Main/relays.pdf
http://www.instructables.com/id/Connecting-a-12V-Relay-to-Arduino/?ALLSTEPS

or if it is DC solenoid, you can control it with transistor, MOSFET, etc
http://playground.arduino.cc/Learning/SolenoidTutorial
55  Using Arduino / Project Guidance / Re: Switching / monitoring multiple mains outlets & environmental. on: May 25, 2014, 12:17:11 am
Here are some of the links

http://www.panu.it/ardupower/
http://openenergymonitor.org/emon/buildingblocks
56  Using Arduino / Project Guidance / Re: Random() gives the same number in a library, no analog pins available for seed on: May 24, 2014, 06:59:51 pm

If you using this "The reliable but not very sexy way to seed random"
Please add in this line
Code:
#include <avr/eeprom.h>
57  Using Arduino / Project Guidance / Re: Changing an LED color at a certain time (time based visual alert) on: May 21, 2014, 05:38:36 pm
The Time library is a software RTC. Additionally, it can be interfaced to a hardware RTC, but this is not required. As noted, without additional hardware, accuracy is dependent on the system clock.
58  Using Arduino / Project Guidance / Re: 'Cuckoo Clock' on: May 21, 2014, 05:22:23 pm
You do not need the while(true){} infinite loop

Code:
int speakerPin = 9;
//speaker connected to one of the PWM ports
int ledPins[] = {2,3,4,5,6,7,8,1,10,11,12,13};
 
#define c 261
#define d 294
#define e 329
#define f 349
#define g 391
#define gS 415
#define a 440
#define aS 455
#define b 466
#define cH 523
#define cSH 554
#define dH 587
#define dSH 622
#define eH 659
#define fH 698
#define fSH 740
#define gH 784
#define gSH 830
#define aH 880
//frequencies for the tones we're going to use

 void setup()
{
  int index;
 
  for(index = 0; index <= 11; index++)
  {
    pinMode(ledPins[index],OUTPUT);
  }
  pinMode(speakerPin, OUTPUT);
  //sets the speakerPin to be an output
}

void loop() // run over and over again
{
  oneAfterAnotherLoop();
}

void oneAfterAnotherLoop()
{
  int index;
  int delayTime = 30;
 
  for(index = 0; index <= 11; index++)
  {
    digitalWrite(ledPins[index], HIGH);
    delay(delayTime);
  march();
  // while(true){}//remove for infinite loop   
  }                                 

 
  for(index = 11; index >= 0; index--)
  {
    digitalWrite(ledPins[index], LOW);
    delay(delayTime);
     march();
  // while(true){}//remove for infinite loop
  }               
}

void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds)
{

    //use led to visualize the notes being played
   
    int x;
    long delayAmount = (long)(1000000/frequencyInHertz);
    long loopTime = (long)((timeInMilliseconds*1000)/(delayAmount*2));
    for (x=0;x<loopTime;x++)
    {
        digitalWrite(speakerPin,HIGH);
        delayMicroseconds(delayAmount);
        digitalWrite(speakerPin,LOW);
        delayMicroseconds(delayAmount);
    }
   

   
    delay(20);
    //a little delay to make all notes sound separate
}
 
void march()
{
    //for the sheet music see:
    //http://www.musicnotes.com/sheetmusic/mtd.asp?ppn=MN0016254
    //this is just a translation of said sheet music to frequencies / time in ms
    //used 500 ms for a quart note
   
    beep(speakerPin, a, 500);
    beep(speakerPin, a, 500);     
    beep(speakerPin, a, 500);
    beep(speakerPin, f, 350);
    beep(speakerPin, cH, 150);
   
    beep(speakerPin, a, 500);
    beep(speakerPin, f, 350);
    beep(speakerPin, cH, 150);
    beep(speakerPin, a, 1000);
    //first bit
   
    beep(speakerPin, eH, 500);
    beep(speakerPin, eH, 500);
    beep(speakerPin, eH, 500);   
    beep(speakerPin, fH, 350);
    beep(speakerPin, cH, 150);
   
    beep(speakerPin, gS, 500);
    beep(speakerPin, f, 350);
    beep(speakerPin, cH, 150);
    beep(speakerPin, a, 1000);
    //second bit...
   
    beep(speakerPin, aH, 500);
    beep(speakerPin, a, 350);
    beep(speakerPin, a, 150);
    beep(speakerPin, aH, 500);
    beep(speakerPin, gSH, 250);
    beep(speakerPin, gH, 250);
   
    beep(speakerPin, fSH, 125);
    beep(speakerPin, fH, 125);   
    beep(speakerPin, fSH, 250);
    delay(250);
    beep(speakerPin, aS, 250);   
    beep(speakerPin, dSH, 500); 
    beep(speakerPin, dH, 250); 
    beep(speakerPin, cSH, 250); 
    //start of the interesting bit
   
    beep(speakerPin, cH, 125); 
    beep(speakerPin, b, 125); 
    beep(speakerPin, cH, 250);     
    delay(250);
    beep(speakerPin, f, 125); 
    beep(speakerPin, gS, 500); 
    beep(speakerPin, f, 375); 
    beep(speakerPin, a, 125);
   
    beep(speakerPin, cH, 500);
    beep(speakerPin, a, 375); 
    beep(speakerPin, cH, 125);
    beep(speakerPin, eH, 1000);
    //more interesting stuff (this doesn't quite get it right somehow)
   
    beep(speakerPin, aH, 500);
    beep(speakerPin, a, 350);
    beep(speakerPin, a, 150);
    beep(speakerPin, aH, 500);
    beep(speakerPin, gSH, 250);
    beep(speakerPin, gH, 250);
   
    beep(speakerPin, fSH, 125);
    beep(speakerPin, fH, 125);   
    beep(speakerPin, fSH, 250);
    delay(250);
    beep(speakerPin, aS, 250);   
    beep(speakerPin, dSH, 500); 
    beep(speakerPin, dH, 250); 
    beep(speakerPin, cSH, 250); 
    //repeat... repeat
   
    beep(speakerPin, cH, 125); 
    beep(speakerPin, b, 125); 
    beep(speakerPin, cH, 250);     
    delay(250);
    beep(speakerPin, f, 250); 
    beep(speakerPin, gS, 500); 
    beep(speakerPin, f, 375); 
    beep(speakerPin, cH, 125);
           
    beep(speakerPin, a, 500);           
    beep(speakerPin, f, 375);           
    beep(speakerPin, c, 125);           
    beep(speakerPin, a, 1000);       
    //and we're done \รณ/   
}
59  Using Arduino / Project Guidance / Re: Arduino code for fuzzy logic controller on: May 21, 2014, 08:15:49 am
I had successfully compile the code.

Quote
Sketch uses 14,534 bytes (45%) of program storage space. Maximum is 32,256 bytes.
Global variables use 339 bytes (16%) of dynamic memory, leaving 1,709 bytes for local variables. Maximum is 2,048 bytes.

Had you install the eFLL (Embedded Fuzzy Logic Library) library for Embedded Systems?
https://github.com/zerokol/eFLL

http://forum.arduino.cc/index.php?topic=124827.0
60  Using Arduino / Programming Questions / Re: Need help with code. on: May 17, 2014, 10:23:29 am
This code adapt from @Robin2 "Demonstration code for several things at the same time"
http://forum.arduino.cc/index.php?topic=223286.0

Code:
// This code adapt from Robin2 "Demonstration code for several things at the same time"
// http://forum.arduino.cc/index.php?topic=223286.0
// this sketch does the following

//    it turns the Led (buttonLed connected to pin 11,12,13) on or off whenever a button
//       connected to pin 2,3,4 is pressed


//  One leg of each LED should be connected to the relevant pin and the other leg should be connected to a
//   resistor of 470 ohms or more and the other end of the resistor to the Arduino GND.
//   If the LED doesn't light its probably connected the wrong way round.


//    The use of millis() to manage the timing of activities
//    The definition of all numbers used by the program at the top of the sketch where
//       they can easily be found if they need to be changed


//========================================

// --------CONSTANTS (won't change)---------------

const int buttonLed1_Pin = 13;      // the pin numbers for the LEDs
const int buttonLed2_Pin = 12;
const int buttonLed3_Pin = 11;

const int buttonPin1 = 2; // the pin number for the button
const int buttonPin2 = 3; // the pin number for the button
const int buttonPin3 = 4; // the pin number for the button

const int buttonInterval = 300; // number of millisecs between button readings

//------------ VARIABLES (will change)---------------------

byte buttonLed1_State = LOW;             // used to record whether the LEDs are on or off
byte buttonLed2_State = LOW;           //   LOW = off
byte buttonLed3_State = LOW;

unsigned long currentMillis = 0;    // stores the value of millis() in each iteration of loop()

unsigned long previousButtonMillis = 0; // time when button press last checked

//========================================

void setup() {

  Serial.begin(9600);
  Serial.println("Starting LED Button");  // so we know what sketch is running
 
      // set the Led pins as output:
  pinMode(buttonLed1_Pin, OUTPUT);
  pinMode(buttonLed2_Pin, OUTPUT);
  pinMode(buttonLed3_Pin, OUTPUT);
 
      // set the button pin as input with a pullup resistor to ensure it defaults to HIGH
  pinMode(buttonPin1, INPUT_PULLUP);
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(buttonPin3, INPUT_PULLUP);
   
}

//========================================

void loop() {

      // Notice that none of the action happens in loop() apart from reading millis()
      //   it just calls the functions that have the action code

  currentMillis = millis();   // capture the latest value of millis()
                              //   this is equivalent to noting the time from a clock
                              //   use the same time for all LED flashes to keep them synchronized
 
  readButton();               // call the functions that do the work
  switchLeds();

}

//========================================

void switchLeds() {
      // this is the code that actually switches the LEDs on and off

  digitalWrite(buttonLed1_Pin, buttonLed1_State);
  digitalWrite(buttonLed2_Pin, buttonLed2_State);
  digitalWrite(buttonLed3_Pin, buttonLed3_State);
}

//========================================

void readButton1() {

      // this only reads the button state after the button interval has elapsed
      //  this avoids multiple flashes if the button bounces
      // every time the button is pressed it changes buttonLed_State causing the Led to go on or off
      // Notice that there is no need to synchronize this use of millis() with the flashing Leds
 
  if (millis() - previousButtonMillis >= buttonInterval) {

    if (digitalRead(buttonPin1) == LOW) {
      buttonLed1_State = ! buttonLed1_State; // this changes it to LOW if it was HIGH
                                           //   and to HIGH if it was LOW
    }
    if (digitalRead(buttonPin2) == LOW) {
      buttonLed2_State = ! buttonLed2_State; // this changes it to LOW if it was HIGH
                                           //   and to HIGH if it was LOW
    }
    if (digitalRead(buttonPin3) == LOW) {
      buttonLed3_State = ! buttonLed3_State; // this changes it to LOW if it was HIGH
                                           //   and to HIGH if it was LOW
    }
    previousButtonMillis = millis();
  }

}

//========================================END
Pages: 1 2 3 [4] 5 6 ... 34