Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / RE: TinyGPS++ Library Issues on: September 20, 2014, 11:59:48 pm
Hi Gang

I've recently purchased a GPS to use with my Arduino UNO. Unfortunately, I've encountered two problems.

1. If I run the example sketch 'Device Example' on my Windows 8 machine I get the following via the Serial Monitor and nothing else.

Quote
DeviceExample.ino
A simple demonstration of TinyGPS++ with an attached GPS module
Testing TinyGPS++
by Mikal Hart

If I run the same sketch on my friend's Mac it works fine?

2. I'd like to play a tone that reflects my position relative to home. I've written the following;

Code:
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

SoftwareSerial ss(2,3);
TinyGPSPlus gps;

double courseToMe = 0;
double homeLat = 48.85823;
double homeLng = 2.29438;

void setup(){
  Serial.begin(115200);
  ss.begin(38400);
  while(!gps.location.isValid()){
    while(ss.available() > 0)
      gps.encode(ss.read());
    Serial.println("NOT VALID");
    delay(1000);
  }
  Serial.println("VALID");
}

void loop(){
  while(ss.available() > 0)
    gps.encode(ss.read());
  courseToMe= TinyGPSPlus::courseTo(homeLat, homeLng, gps.location.lat(), gps.location.lng());
  tone(10, 31 + (2 * courseToMe));
  delay(1000);
}

I'm getting the most peculiar behavior. The tone pulses. smiley-sad

Can anyone suggest a solution to either problem?

Cheers

Jase smiley
2  Using Arduino / Project Guidance / Re: Servo8Bit Library Not Working on: August 28, 2014, 03:48:28 pm
Hi tylernt

I'm using the ATTiny45 so I've taken on your advice and settled on using the SoftwareServo library. As stated earlier a really appreciate the help and wish you the best of luck with your project.

Cheers

Jase smiley
3  Using Arduino / Project Guidance / Re: Servo8Bit Library Not Working on: August 27, 2014, 03:52:12 pm
Hi tylernt

Thanks for getting back to me. So aside from changing the core is the process for uploading sketches identical (UNO as ISP etc)? Is the TinyServo library part of your core rather than an add on (similar to Arduino Servo library)? I particularly interested in the writeMicroseconds function as this gives me far more control a feature that is not available using the SoftwareServo library. Really appreciate your help.

Cheers

Jase smiley
4  Using Arduino / Project Guidance / Servo8Bit Library Not Working on: August 27, 2014, 08:08:24 am
Hi Gang

I'd like to program an ATTiny via the Arduino IDE. Specifically, I'd like to use the Servo8Bit library but I'm not having much luck. I've read and downloaded the following;

ATTiny

Servo8Bit Library

I've placed both the above in my sketchbook folder as per Arduino preferences. ATTiny in hardware folder and Servo8Bit in software folder.

I've uploaded the following sketch to test.

Code:
#include "Servo8Bit.h"

Servo8Bit myServo;  //create a servo object.
                    //a maximum of five servo objects can be created


void setup()
{
  //myServo.attach(1,544,2400);  //this is the default values
  myServo.attach(1,544,2200);  //attach the servo to pin PB1     
}


void loop()
{
   
    for(int pos = 0; pos < 180; pos++)  // goes from 0 degrees to 180 degrees
    {                                   // in steps of 1 degree
        myServo.write(pos);             // tell servo to go to position in variable 'pos'
        delay(15);                      // waits 15ms for the servo to reach the position
    }

    for(int pos = 180; pos > 1; pos--)  // goes from 180 degrees to 0 degrees
    {
        myServo.write(pos);             // tell servo to go to position in variable 'pos'
        delay(15);                      // waits 15ms for the servo to reach the position
    }
}

When I upload this using the Arduino Uno as an ISP the servo doesn't move.

If I use the SoftwareServo library then the servo does move.

Code:
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
 
int pos = 0;    // variable to store the servo position
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}


I'd prefer to use the Servo8Bit library as it has more functionality. Can someone suggest what I may be doing wrong?

Cheers

Jase smiley
5  Using Arduino / Project Guidance / Re: Servo Library TimerOne Library Conflict on: August 20, 2014, 08:27:42 am
Hi holmes4

Thanks for getting back to me. I am currently using an Arduino Uno.

TimerThree Library

Cheers

Jase smiley
6  Using Arduino / Project Guidance / Servo Library TimerOne Library Conflict on: August 20, 2014, 06:19:26 am
Hi Gang

I've been working on a project using the Servo library in conjunction with the TimerOne library but I'm not having much luck. It appears the two libraries don't like one another. Am I correct in thinking that the reason for this is that they both share Timer 1? If this is the case, is the solution to simply use TimerThree library or is it not quite that simple?

Cheers

Jase smiley
7  Using Arduino / Microcontrollers / Re: Arduino IDE and ATTiny45 on: June 13, 2014, 07:04:55 am
Hi Gang

Thanks for the responses. I've followed through the instructions in the README file. I'm unsure what the following instruction means?

* In the "boards.txt" file, change the "upload.tool" entries to the appropriate value for your setup.

If I check the text file I find the following.

attiny45at8.upload.tool=arduino:arduinoisp

What do I need to do with the above statement?

As always appreciate the help.

Cheers

Jase smiley
8  Using Arduino / Microcontrollers / Re: Arduino IDE and ATTiny45 on: June 12, 2014, 03:46:12 pm
Hi Gang

Sorry for the late reply. I've been under the weather.

@Erni: I've downloaded the latest version for 1.5 but the boards still do not appear. smiley-sad

@spycatcher2k: Will an earlier version of Arduino work with Windows 8.1?

@johnwasser: I've tried installing both cores. smiley-sad

Cheers

Jase smiley
9  Using Arduino / Microcontrollers / Arduino IDE and ATTiny45 on: June 09, 2014, 02:41:43 pm
Hi Gang

I'm keen to use the Arduino IDE to program an ATTiny45. I've watched the following video How-To: Shrinkify Your Arduino Projects but I'm having a problem. If I click Tools > Boards none of the ATTiny boards appear. I've followed the instructions and placed the appropriate folders and files in the correct locations. Any help would be greatly appreciated.

OS: Windows 8
Arduino IDE: Arduino 1.5.6-r2
Sketchbook Location: C:\Users\Jason\Documents\Arduino
File path for attiny: This PC > Documents > Arduino > hardware > attiny

Cheers

Jase smiley
10  Using Arduino / Project Guidance / Re: ATTiny45 Servo8Bit Library Problem on: March 27, 2014, 02:39:54 pm
Hi Gang

All sorted. The problem appears to be because of two reasons. Bad ground and overheating the ATTiny45 when soldering.

Cheers

Jase smiley
11  Using Arduino / Project Guidance / ATTiny45 Servo8Bit Library Problem on: March 24, 2014, 05:47:43 am
Hi Gang

I've been experimenting with the ATTiny45 and the Servo8Bit Library.  All works fine provided I use a small servo. If I try to use a large servo it doesn't work. I've connected everything as per the diagram below.

My hunch is that it has something to do with the clock speed. The ATTiny internal clock runs at 1MHz by default but can be changed to 8MHz (which is recommended and I've done) vs Arduino Uno which is 16MHz. Has anyone experienced a similar problem?

Cheers

Jase smiley

12  Using Arduino / Project Guidance / Re: Arduino Uno AREF on: March 08, 2014, 03:30:00 pm
Hi Mark

Thanks for the reply. I'm relatively new to electronics so I'm not quite sure what you are saying here?

Quote
AREF needs a low impedance voltage reference, it has significant current flow, so
a voltage divider won't be very accurate (about 0.15mA which may vary during conversion)

I thought impedance was related to AC? Will using a voltage divider reduce the current flow too much even though it will be the correct voltage?

Cheers

Jase smiley
13  Using Arduino / Project Guidance / Re: Arduino Uno AREF on: March 08, 2014, 03:17:27 pm
Hi PaulRB

Thanks for the reply. I'm relatively new to electronics so I don't quite follow your suggestion;

Quote
If you know the supply voltage is stable, or you are using an external voltage regulator or the Arduino's regulator, you can measure the regulated supply with your DMM and not bother with the internal reference. Internal voltage ref can be very useful if the Arduino is powered by batteries and you are bypassing the voltage regulator to increase battery life for example.

If measuring such a small range of voltages using the ~5V supply as reference is not sufficiently accurate, you can use a voltage divider to scale down the voltage to be measured. You could do this with the internal reference also.

Are the above simply general characteristics of AREF?

Cheers

Jase smiley
14  Using Arduino / Project Guidance / Arduino Uno AREF on: March 08, 2014, 05:39:45 am
Hi Gang

I'm trying use an Arduino Uno to read the RSSI voltage of a video receiver which varies between 0.5V and 1.15V. I'm thinking my simplest solution would be to use analogReference(INTERNAL); which is 1.1V to give me the best resolution. My concern is that I 'may' exceed the AREF voltage by 0.05V. Will this be a problem?

Cheers

Jase smiley
15  Using Arduino / Project Guidance / Arduino Servo Library & GWS 125-1T/2BB/J on: March 03, 2014, 05:16:29 am
Hi Gang

I've recently purchased a GWS 125-1/2BB/J servo. This is a 360 degree servo. I've tried using the Arduino Servo Library but it over rotates  (turns more than 360 degrees). If I use a servo tester it works fine. My hunch is has something to do with the attach() function. Specifically the min and max parameters. I've tried checking ServoDatabase.com but there is surprisingly little information on this popular servo.  Has anyone had any experience with this servo or can possibly guide me?

Cheers

Jase smiley

Pages: [1] 2 3 4