Show Posts
Pages: 1 ... 16 17 [18] 19 20
256  Using Arduino / Motors, Mechanics, and Power / Re: New 28BYJ-48 library on: January 30, 2012, 04:43:49 pm
Haha, many times I have almost ordered a Gigapan. But the local camera shop over here wants 1000€ for the pro version. Which I need for my Nikon D300/700. Never heard of the Bescor, looks like a nice cheap solution. It's on my wanted list, thanks for the info.
257  Using Arduino / Motors, Mechanics, and Power / Re: New 28BYJ-48 library on: January 30, 2012, 02:48:47 pm
I just tried it out, had not seen that you posted the .pde file  smiley-red It does work very well. I've thought about buying a cheap tripod and add a stepper motor to it to make 360 pano's. Might be possible with this little motor? That's quite a bit of code you have written, hats off to you!
258  Using Arduino / Motors, Mechanics, and Power / Re: New 28BYJ-48 library on: January 30, 2012, 01:08:30 pm
Could please post an example sketch using the code # button? I can't figure out the code in the first post.
259  Using Arduino / General Electronics / Re: Power from wall socket with USB connected? on: January 29, 2012, 05:18:00 am
I power the nrf24l01 from the 3,3V pin, according to the official Arduino website the 3,3V bus is limited to 50mA. The datasheet of the nrf24l01 says that the chip only draws 12mA max. If I connect the module to my Uno I works without problems (powered by USB only). Weird  smiley-confuse
260  Using Arduino / General Electronics / Re: Power from wall socket with USB connected? on: January 28, 2012, 04:57:31 pm
Ok, thank you.
261  Using Arduino / General Electronics / Power from wall socket with USB connected? on: January 28, 2012, 04:01:07 pm
Will this work? Connect a 9V/1,1A power adapter AND usb cable from my pc to read the serial monitor. Will the Arduino Mega 2560 select the power adapter and can the USB still be used to read the serial monitor?
It's just for testing purposes, I'm having some strange issues with my Mega 2560 connected to a nRF24L01+. When I just have the USB cable connected I get very bad reception and lots of time outs but with the power adapter connected it seems to work fine. I want to have a look with the serial monitor to see what happens.
262  Using Arduino / Motors, Mechanics, and Power / Re: New 28BYJ-48 library on: January 28, 2012, 06:42:04 am
I'm interested in this, I have 2 of these little motors. Can't believe they have enough power to spin a DSLR. Please make a video of it smiley-grin
263  Using Arduino / Networking, Protocols, and Devices / Re: rf2401 problem with mega 2560 on: January 28, 2012, 06:36:30 am
Just tested 2 Nrf24L01 modules, one connected to an Uno the other to a Mega 2560. I tested them with the getting started sketch that comes with the library. In the sketch for the Mega I set (radio(49,53)) and set pinMode 53 to output. I works but not like it should. About 80% of the pings times out when I transmit from the Mega, when I transmit from the Uno it's a little bit better (about 40% times out). Anyone have any ideas how I can improve this?
264  Using Arduino / Programming Questions / Re: Bytes to decimals to an integer? on: January 25, 2012, 04:24:21 pm
I think it should be 0x12? 18 in hex is 0x12, this works smiley
Thanks for the help.
 
265  Using Arduino / Programming Questions / Bytes to decimals to an integer? on: January 25, 2012, 04:09:28 pm
I started this from a sketch where a PIR detector turns on a light and after 30 seconds the light goes out. This works. Earlier this week I bought a little DS1307 module and hooked it up through I2C to my Arduino Uno. Now I want to only turn on the light in the evening (lets say after 18:00) and if the PIR detector is high. For the DS1307 module I used some code I found here -> http://combustory.com/wiki/index.php/RTC1307_-_Real_Time_Clock
I can read the time from the DS1307 (serial monitor).
The only bit that doesn't work is this: "if (pirState == HIGH && (hour, DEC) >= 18)"  Do I need to convert the "hour"?
Could someone give me some pointers on how I can accomplish this?
This is the complete sketch:
Code:
/*
  http://www.bajdi.com
  PIR detector turns on light, light switches automatically off after 30 seconds.
  Light must only turn on in the evening (after 18:00) 
 */

#include <Wire.h>
const int DS1307_I2C_ADDRESS = 0x68;
const int pir = 2;     // the number of the PIR pin
const int light =  13;      // the number of the light pin

unsigned long on;      //start time for pir light on

int pirState = 0;         // variable for reading the pushbutton status

byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;

// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
  return ( (val/16*10) + (val%16) );
}



void getDateDs1307()
{
  // Reset the register pointer
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x00);
  Wire.endTransmission();
 
  Wire.requestFrom(DS1307_I2C_ADDRESS, 7);
 
  // A few of these need masks because certain bits are control bits
  second     = bcdToDec(Wire.receive() & 0x7f);
  minute     = bcdToDec(Wire.receive());
  hour       = bcdToDec(Wire.receive() & 0x3f);  // Need to change this if 12 hour am/pm
  dayOfWeek  = bcdToDec(Wire.receive());
  dayOfMonth = bcdToDec(Wire.receive());
  month      = bcdToDec(Wire.receive());
  year       = bcdToDec(Wire.receive());
 
}

void setup() {
  Wire.begin();
  Serial.begin(9600);
  pinMode(light, OUTPUT);     
  pinMode(pir, INPUT);
}

void loop(){

  getDateDs1307();
  Serial.println("  ");
  Serial.print(hour, DEC);
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.println("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.println(year, DEC);
  delay(2000);   //slow down serial monitor for testing
 
  pirState = digitalRead(pir);

  if (pirState == HIGH && (hour, DEC) >= 18) {     
    digitalWrite(light, HIGH); 
    on = millis();
  }

  unsigned long currentMillis = millis();

  if ((currentMillis - on) > 30000) {
    digitalWrite(light, LOW);
  }
 
}


 
266  Using Arduino / General Electronics / Re: I2C and voltages on: January 24, 2012, 04:49:30 pm
I didn't know about the PCA9306, looks like a very easy solution if you want to combine 3,3 and 5V I2C devices. Will have to order one smiley Thanks for the info.
267  Using Arduino / Project Guidance / Re: Getting the Accelerometer (ADXL345) to work on: January 23, 2012, 11:47:26 am
The ADXL345 that I have doesn't "start" automatically, I have to sent a command to it before it starts sending data. I don't use the SPI bus like the sparkfun example but the I2C bus with the following library http://code.google.com/p/adxl345driver/ I did have some trouble to get it working, you can read about it on my blog.
268  Using Arduino / Project Guidance / Re: Multi Room Temperature Sensors and Reporting Station on: January 22, 2012, 10:25:46 am
Have a look at this: http://nootropicdesign.com/projectlab/2010/12/26/rf-wireless-temperature-sensor/
269  Using Arduino / Project Guidance / Re: Mega 2560 with Ethernet shield on: January 22, 2012, 09:59:13 am
Have you tried the sketch that zoomkat posted? What does the serial monitor say? Have you tried pinging the ethernet shield from your computer? Is the IP that you used in the sketch in the same range as your computer?
270  Using Arduino / General Electronics / Re: I2C and voltages on: January 21, 2012, 06:39:37 pm
I've been playing with an ADXL345 accelerometer, also a 3,3V device connected to my Uno. I connected 2 4k7 resistors between SDA/SCL and 3,3V. Becomes more difficult when you want to combine 3,3 and 5V devices on the same I2C bus.
Pages: 1 ... 16 17 [18] 19 20