Show Posts
Pages: 1 ... 382 383 [384] 385 386 ... 600
5746  Using Arduino / Installation & Troubleshooting / Re: Mega ADK box says 7-18V, is it really 18V (the site here says 12V) on: May 05, 2012, 04:34:49 pm
The regulator can probably handle 18 but the higher the voltage the more power gets wasted as heat in the regulator.  The actual maximum will depend on hoe much current your circuit draws because that will determine how much power the regulator will have to dissipate into the air and thus how hot the regulator gets.  At some point the regulator will overheat and fail.
5747  Using Arduino / Sensors / Re: 4 wire DS touchscreen, nano, and analog 6 and 7 on: May 05, 2012, 04:30:06 pm
Looks like A6 and A7 aren't supported as digital I/O pins.  The "eightanaloginputs' variant changes "NUM_ANALOG_INPUTS" to 8 but doesn't change "NUM_DIGITAL_PINS" to 22.  Even if it did, the arrays that match pin numbers to ports don't have entries for those two pins.
5748  Using Arduino / Programming Questions / Re: Setting time on RTC 1307 - Binary lilypad clock on: May 05, 2012, 04:14:04 pm
I have been playing with the Binary Clock featured in the Evil Genius book.

Had a problem with running too slow so I attached a RTC to A4 and A5 for time reading.

I would like the time adjust button (moved from pin 18 to pin 11) to step the minutes forward and reset the seconds to 0 and then set this as the new time in the RTC.  I cannot get this to work.  I also added in a serial printout so I can view the time while plugged in.  Below is my coding...  Any suggestion on setting time forward, resetting seconds, and writing to RTC?
Code:
void loop()                     
{
  if (digitalRead(switchPin))
  {
    //RTC.set(time_t);
    //adjustTime(60);
    // delay(100);

    //second() == 0;
    //spin(hour());
    //setTime(t)
  }

Of course it won't work if you comment out all the code!  smiley

I think the problem is that you tell the RTC library to set the time first  and THEN change the time.  Perhaps it would work if you changed the time and THEN set the RTC:
Code:
  {
    adjustTime(60-second());  // Move the clock forward to the next minute   
    RTC.set(now());  // Set the RTC to the new time
  }
5749  Topics / Robotics / Re: New to Robotics - getting started? on: May 05, 2012, 03:49:36 pm
If you can find an old RC electric car anywhere (yard sale or thrift store) you can probably connect the Arduino in place of the RC receiver and re-use the motor drivers, motors, wheels, etc.  I've found that RC cars often sell for $4 at thrift stores like Savers.

If you want commercial parts you can get the chassis, motors, and wheels for $30 from http://www.robotshop.com/dagu-mr-basic-mobile-robotic-platform-2.html  You will need a motor driver shield to drive the motors.  For $36 you can get a plastic chassis with four separate motors: http://sumaoutlet.com/1pcs-4wd-robot-smart-car-chassis-kits-arduino-car-with-speed-enc-p-3709.html  Many other choices if you look around the RobotShop site.
5750  Using Arduino / Programming Questions / Re: Some help with older code pre 1.0 (motor control) on: May 05, 2012, 03:10:52 pm
This version compiles.  Just had to change the three lines that used the BYTE keyword.
Code:
// TWIN WHEELER MODIFIED FOR ARDUINO SIMPLIFIED SERIAL PROTOCOL TO SABERTOOTH V2

// **********THIS VERSION JUST TESTS COMMUNICATION BETWEEN ARDUINO AND SABERTOOTH AND MOTORS PLUS DEADMAN SWITCH****************
// *********** DEADMAN SWITCH MUST BE PRESSED IN, MOTORS WILL STOP IF RELEASED **********************
// MOTORS WILL INCREASE IN SPEED BY 10% EVERY 5 SECONDS UNTIL 50% OF FULL POWER IS REACHED
// THEY WILL THEN GO DOWN TO ZERO IN STEPS OF 10%.

// BOTH WHEELS SHOULD BE SPINNING IN SAME DIRECTION AT THE SAME SPEED AT ALL TIMES ELSE YOU WILL HAVE WIRED ONE MOTOR UP BACK TO FRON

// SABERTOOTH MUST HAVE DIP SWITCHES SET TO THE SERIAL MODE:i.e. DIP switches 1, 3, 5 and 6 set to ON, the remainder set to OFF

// IMU NOT CONNECTED AT THIS POINT (CAN BE PHYSICALLY CONNECTED IF YOU LIKE BUT ARDUINO WILL NOT BE READING IT AT ALL)

// ONLY THING YOU NEED IS DEAD MAN SWITCH TO DIGITAL PIN 9 (+5V TO PIN 9 WHEN SWITCH PRESSED, PULL DOWN RESISTOR FROM PIN 9 TO GND
// KEEPS IT AT 0V OTHERWISE)

// J. Dingley  March 1 2011 For Arduino 328 Duemalinove or similar with a 3.3V accessory power output
// i.e. the current standard Arduino board.

#include <SoftwareSerial.h>


//******************** IMPORTANT ***************************
//Set dip switches on the Sabertooth for simplified serial and 9600 Buadrate. Diagram of this on my Instructables page//
//i.e. DIP switches 1, 3, 5 and 6 set to ON, the remainder set to OFF
//******************** IMPORTANT ***************************


//Digital pin 13 is serial transmit pin to sabertooth
#define SABER_TX_PIN  13
//Not used but still initialised, Digital pin 12 is serial receive from Sabertooth
#define SABER_RX_PIN  12

//set baudrate to match sabertooth dip settings
#define SABER_BAUDRATE  9600

//simplifierd serial limits for each motor
#define SABER_MOTOR1_FULL_FORWARD 127
#define SABER_MOTOR1_FULL_REVERSE 1

#define SABER_MOTOR2_FULL_FORWARD 255
#define SABER_MOTOR2_FULL_REVERSE 128

//motor level to send when issuing full stop command
#define SABER_ALL_STOP  0

SoftwareSerial SaberSerial = SoftwareSerial (SABER_RX_PIN, SABER_TX_PIN );

void initSabertooth (void)  {
  //initialise software to communicate with sabertooth
  pinMode ( SABER_TX_PIN, OUTPUT );

  SaberSerial.begin( SABER_BAUDRATE );
  //2 sec delay to let it settle
  delay (2000);
  SaberSerial.write((byte)0);   //kill motors when first switched on
}


float level = 0;

int u;

//float k1;
//int k2;
//int k3;
int k4;

signed char Motor1percent;
signed char Motor2percent;

//DIGITAL INPUT
int deadmanbuttonPin = 9;  // deadman button is digital input pin 9

void setup()                    // run once, when the sketch starts
{
  initSabertooth( );
  //analogINPUTS

  //digital inputs
  pinMode(deadmanbuttonPin, INPUT);

  Serial.begin(9600);      // HARD wired Serial feedback to PC for debugging in Wiring
}


void sample_inputs()  {
  k4 = digitalRead(deadmanbuttonPin);  //this is needed - if you let go the motors both stop for your own safety
}


void set_motor()   {
  unsigned char cSpeedVal_Motor1 = 0;
  unsigned char cSpeedVal_Motor2 = 0;

  //set motors using the simplified serial Sabertooth protocol (same for smaller 2 x 5 Watt Sabertooth by the way)

  Motor1percent = (signed char) level;
  Motor2percent = (signed char) level;

  Serial.print("level ");
  Serial.println(level);

  if (Motor1percent > 100) Motor1percent = 100;
  if (Motor1percent < -100) Motor1percent = -100;
  if (Motor2percent > 100) Motor2percent = 100;
  if (Motor2percent < -100) Motor2percent = -100;

  //if not pressing deadman button on hand controller - cut everything
  if (k4 < 1) {
    level = 0;

    Motor1percent = 0;
    Motor2percent = 0;
    Serial.println("Pressing Dead Man Button");
    delay(1000);
  }

  cSpeedVal_Motor1 = map (Motor1percent,
  -100,
  100,
  SABER_MOTOR1_FULL_REVERSE,
  SABER_MOTOR1_FULL_FORWARD);

  cSpeedVal_Motor2 = map (Motor2percent,
  -100,
  100,
  SABER_MOTOR2_FULL_REVERSE,
  SABER_MOTOR2_FULL_FORWARD);

  SaberSerial.write (cSpeedVal_Motor1);
  SaberSerial.write (cSpeedVal_Motor2);

  /*
 //debugging
   Serial.print("Motor1percent = ");
   Serial.print(Motor1percent);
   Serial.print ("  level = ");
   Serial.println (level);
   
   Serial.print("Motor2percent = ");
   Serial.println(Motor2percent);
   Serial.print("cSpeedVal_Motor1 = ");
   Serial.println(cSpeedVal_Motor1);
   Serial.print("cSpeedVal_Motor2 = ");
   Serial.println(cSpeedVal_Motor2);
   */
  delay(5000); //5 second delay

}

void loop ()   {
  for (u=0; u<5; u++) {
    level= u * 10; //level = 0 then 10, then 20 until it gets to 50% of max motor power. each set motor routine has 5 sec delay at end of it
    sample_inputs(); //check the dead man button still pressed in
    set_motor();
  }
  for (u=0; u<5; u++) {
    level= (5- u) * 10; //level = 50 then 40, then 30 then 20 until it gets to 0% of max motor power. each set motor routine has 5 sec delay at end of it
    sample_inputs();//check the dead man button still pressed in
    set_motor();
  }
}
5751  Using Arduino / Programming Questions / Re: any sensor that sense human... on: May 05, 2012, 02:53:02 pm
I know of no sensor that can tell the different between a human and any other large primate.
5752  General Category / General Discussion / Re: Im new! And i come with a question! on: May 05, 2012, 02:51:22 pm
Sylvia, who with the help of her parents produces Sylvia's Super Awesome [mini] Maker Show, is about 9 and has not problem using the Arduino.  I think kids as young as 4 have taken soldering classes.  If you want to learn something there is no better time to start than now.
5753  Using Arduino / Programming Questions / Re: Problem with TimeNTP from Time library on: May 05, 2012, 02:45:34 pm
UdpNtpClient compiles without error for me under Arduino 1.0.  Perhaps you should re-install Arduino 1.0.
5754  Using Arduino / Project Guidance / Re: Investigating project feasibilty - a question on shields on: May 05, 2012, 02:38:02 pm
So in order to stack this board I should solder on headers instead of directly to the board as shown and avoid reusing any pins that are used by the motor shield?

The instructions show male header pins.  These are soldered to the bottom of the motor shield with the male pins pointing down.  The male pins plug into the female headers on the Arduino.

If, instead, you get stacking headers (http://www.adafruit.com/products/85) and solder them to the motor shield with the male pins sticking down you will still be able to plug the male pins into the Arduino and plug another shield into the female headers on the motor shield.

If the second shield conflicts with the first shield you will have to kludge some connections by cutting or bending pins and soldering wires.
5755  Using Arduino / Programming Questions / Re: 3.3V / 8Mhz Breadboard ATMEGA328P on: May 05, 2012, 02:13:08 pm
So you have everything wired according to this diagram?

http://arduino.cc/en/uploads/Tutorial/BreadboardAVR.png

Select Tools:Board Duemilanove
Select Tools:Serial Port matching your Duemilanove
Files->Examples->ArduinoISP
Upload
Disable AutoReset on Duemilanove
Select Tools:Board board with 328P and 8 MHz crystal
Select Tools:Burn Bootloader->Using Arduino as ISP

5756  Using Arduino / Programming Questions / Re: Problem with TimeNTP from Time library on: May 05, 2012, 01:42:23 pm
write is defined in print.h as size_t. When I change virtual void UdpBytewiseClass::write(uint8_t) to virtual size_t UdpBytewiseClass::write(uint8_t) this error goes away. But I'm really confused why I get this error in a library that's apparently been around since 2008.
I've got UdPBytewyse.h from https://bitbucket.org/bjoern/arduino_osc/src/tip/libraries/Ethernet/

2008 libraries would be written for pre-1.0 Arduino.  Part of the 1.0 release was having more things inherit behaviors from Print and Stream.  That's why the 2008 code doesn't always work with 2012 libraries.  Might be time to re-write the Time library to work with the 1.0  Ethernet UDP client.  Or maybe just use the existing example:

Files->Examples->Ethernet->UdpNtpClient

5757  Community / Bar Sport / Re: To all you SciFi aficionados. I need your help on: May 05, 2012, 01:19:35 pm
Perhaps a library near you has a copy.  http://www.worldcat.org/title/antibodies/oclc/19655576
5758  Using Arduino / Programming Questions / Re: Does the built in Watchdog work on: May 05, 2012, 01:11:53 pm
Seems to be fixed. Very good to know. Do you know if the bootloader is fixed or what happened?

My understanding of the problem is:

a) The WDT reset does NOT disable the WDT.  This means that if the bootloader doesn't explicitly disable WDT and the bootloader takes longer than the WDT interval to get to your setup() function the WDT will cause a reset loop.

b) The newer bootloaders detect the cause of a reset and either look for a download (Reset line pulled low) or go straight to your sketch (Power-on).  If they treat the WDT reset as a Reset-line reset they would exacerbate issue 'a'.

I'm not sure if/when the bootloaders were changed but the 1.0 UNO bootloader works fine with a 1/4 second WDT.
5759  Using Arduino / Project Guidance / Re: Arduino WiFi websocket to ...ipad? on: May 05, 2012, 12:03:40 pm
I think that what will work easiest is to have the Arduino act as a web server, serving up HTML5 pages and initiating an ad-hoc WiFi network.  The iPad could then connect to the ad-hoc WiFi network and fetch pages from the Arduino.
5760  Using Arduino / Project Guidance / Re: Investigating project feasibilty - a question on shields on: May 05, 2012, 11:57:09 am
In general a 'shield' is designed to plug into the Arduino's headers and can be pulled off as needed.  If you build your shield with stacking headers (male on the bottom, female on the top) you can stack shields as long as there are no pin conflicts.
Pages: 1 ... 382 383 [384] 385 386 ... 600