Show Posts
Pages: [1]
1  Using Arduino / General Electronics / Not reseting/ fuse broken on: April 17, 2013, 05:43:57 am
Hi,

I stupidly put too much current through my Arduino Micro by hooking up a 9V battery to 5V instead of Vin. When I plug it in, the blue light goes on so it still has power but the serial port is not reading it. The reset button also doesn't work. Is there another way I can rest it or is it a goner? smiley-sad
2  Using Arduino / General Electronics / Re: Micro + led on: April 09, 2013, 10:07:14 am
Oh god, I didn't know that about the resistors. Thank you for your help the lights are all blinking
3  Using Arduino / General Electronics / Re: Micro + led on: April 09, 2013, 08:09:02 am
Well one led is working. I hooked up two more but they will only blink on pin 9, even when I changed the code to:

Code:
int led = 9;
int led1=10;
int led2= 5;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);   
 pinMode(led1, OUTPUT); 
pinMode(led2,OUTPUT); 
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);
 digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH); // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW); // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

I think my setup is correct?
4  Using Arduino / General Electronics / Re: Micro + led on: April 09, 2013, 07:15:30 am
Thank you it's finally working!
5  Using Arduino / General Electronics / Micro + led on: April 09, 2013, 05:34:31 am
Hi,

This is very simple but for some reason I can't get an led connection to work with the micro. I normally use the uno but for some reason working off the board with the Arduino is confusing me.

What's wrong with this picture?
6  Using Arduino / Displays / Re: Black Boxes LCD on: April 07, 2013, 09:40:43 am
Yes it's one blob and there are just 8 boxes. Thanks for the information. Sounds like I should've bought a better display!
7  Using Arduino / Displays / Re: Black Boxes LCD on: April 07, 2013, 08:55:42 am
Sorry it went away after I pushed the reset button on the arduino a few times. Still not much luck getting rid of the boxes  smiley-confuse
8  Using Arduino / Displays / Re: Black Boxes LCD on: April 07, 2013, 08:53:15 am
avrdude: ser_drain(): read error: Device not configured

I'm getting this error. Is there a way to configure it?

9  Using Arduino / Displays / Re: Black Boxes LCD on: April 07, 2013, 07:48:19 am
Thanks! I'll have a look and change around the wires.
10  Using Arduino / Displays / Re: Black Boxes LCD on: April 07, 2013, 03:15:58 am
The model is DEM16101

 
Code:


#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
#define   CONTRAST_PIN   9
int backLight = 13;    // pin 13 will control the backlight
#define   CONTRAST       125


void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  analogWrite (CONTRAST_PIN, CONTRAST);
  delay(1000);
  lcd.begin(16,1);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Test");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("hacktronics.com");
 
}

void loop()
{
   
}

11  Using Arduino / Displays / Black Boxes LCD on: April 07, 2013, 02:57:55 am
Hi,

I know quite a few people have had the same problem but I haven't found a solution yet. Whenever I upload a sketch to my LCD the result is always just black boxes.

My setup and code I found from the Hacktronics site.
http://www.hacktronics.com/Tutorials/arduino-character-lcd-tutorial.html

Does anyone know if I need to do something to initialize the LCD or is it most likely a wiring problem?

Thanks!
12  Using Arduino / Installation & Troubleshooting / Arduino Micro on: March 12, 2013, 06:52:59 am
I bought an Arduino Micro but I'm having trouble finding diagrams of projects set up with it. Does the micro always require soldering or can I put it on a breadboard and connect wires?
Sorry for the stupid question. 
13  Using Arduino / Programming Questions / Re: 3 leds one button on: January 19, 2013, 10:19:15 am
Thanks for the code. It's working better.
I'm not sure about the while statement. I was just trying different things since I'm new to coding.
14  Using Arduino / Programming Questions / Re: 3 leds one button on: January 19, 2013, 09:08:18 am
Sorry. Hope this is clearer.


boolean currentled;
int ledPin =3;
boolean last;

void setup() {
  pinMode(2, INPUT);      // set the switch pin to be an input
  pinMode(3, OUTPUT);   // set the yellow LED pin to be an output
  pinMode(4, OUTPUT);   // set the red LED pin to be an output
  pinMode(5, OUTPUT); //set green led as output
}
//function to find out if the 3rd led was the last one pressed
boolean led (boolean last)
{

  {
    boolean last = ledPin;
    if (last !=currentled)
    {

      currentled= ledPin;


    }
    return currentled;
  }



}

void loop() {
  // read the switch input:
  //if no button pressed then no leds should be on
  if (digitalRead(2)==LOW)
  { 
    digitalWrite(3, LOW);   
    digitalWrite(4, LOW);     
    digitalWrite (5, LOW);
  }
  //if pressed then turn on the 3rd led
  else {
    digitalWrite(3, HIGH);   
    digitalWrite(4, LOW);   
    digitalWrite (5, LOW);
  }

  //if the last led that was on was the 3rd then turn on the 5th
  while (currentled =led(last)) {
    digitalWrite(3, LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,HIGH);
  } //else turn on the 4th
  digitalWrite(3, LOW);
  digitalWrite(4,HIGH);
  digitalWrite(5,LOW);

}




15  Using Arduino / Programming Questions / 3 leds one button on: January 19, 2013, 07:25:52 am
Hi,

I'm trying to program a button to turn on three leds one by one. I've only managed to write code so that 2 turn on and they are turning on together. I know I've done something very wrong with the boolean function and there's probably a much better way to do it as well.


boolean currentled;
int ledPin =3;
boolean last;

void setup() {
   pinMode(2, INPUT);      // set the switch pin to be an input
   pinMode(3, OUTPUT);   // set the yellow LED pin to be an output
   pinMode(4, OUTPUT);   // set the red LED pin to be an output
   pinMode(5, OUTPUT); //set green pin as output
 }
 
 boolean led (boolean last)
 {
   
   {
  boolean last = ledPin;
  if (last !=currentled)
  {
     
    currentled= ledPin;
   
   
  }
  return currentled;
}
   
   
   
 }
 
 void loop() {
   // read the switch input:
   if (digitalRead(2)==LOW)
   {  digitalWrite(3, LOW);    // turn on the yellow LED
     digitalWrite(4, LOW);     // turn off the red LED
     digitalWrite (5, LOW);
   }
//   else if (digitalRead(2) == HIGH && currentled =!led(last)) {
//    digitalWrite(3, HIGH);    // turn on the yellow LED
//    digitalWrite(4, LOW);     // turn off the red LED
//    digitalWrite (5, LOW);
// }
//   
 else
if (currentled =led(last) && digitalRead(2)) {
   digitalWrite(3, LOW);
   digitalWrite(4,LOW);
   digitalWrite(5,HIGH);
// } else {
 digitalWrite(3, LOW);
   digitalWrite(4,HIGH);
  digitalWrite(5,LOW);
 
}
 }
Pages: [1]