Show Posts
Pages: 1 2 3 [4] 5 6 ... 38
46  Using Arduino / Networking, Protocols, and Devices / Re: compare GPS data on: December 27, 2013, 02:19:28 pm
first of all u should know that GPS shield from ITEAD studio is not supported by TinyGPS. this means that you should find the coordinates manually..i.e. count every bit of the GPRMC sentence then displaying them. let me look for the code will get back to you shortly.
thanks
AFAIK, TinyGPS doesn't care where the data comes from. It doesn't do the interfacing with any particular GPS, simply takes NMEA sentences and parses them for the data contained within. If you can capture the NMEA sentence from the device and pass to encode() then it will processs it.
47  Using Arduino / Networking, Protocols, and Devices / Re: gps+rf transmitter+rf reciever+arduino uno...but only one uart port.. on: December 27, 2013, 08:41:25 am
You can use Software Serial to connect the GPS.

Or you could use an SPI based RF transceiver like the nRF24L01.
48  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 25, 2013, 09:35:10 pm
I checked that my mods did actually cause input to be pulled high.

I posted in Microcontrollers with both fixes, the changes detailed and copies of amended files attached.

For the INPUT_PULLUP fix it also lists some simple steps to check it works as expected.

Did Fast Pin Mode work before?
49  Using Arduino / Programming Questions / Re: Someone can tell me why this LED doesn't blink a regular time ? on: December 25, 2013, 05:19:31 pm
Code:
T1=T1+1;

What is the value of T1 when you first add 1 to it, and then what is it's value after adding 1 each time? At what point do you give it an initial value, or 'initialise' it?

You can also write the addition easier as

Code:
T1++;

It is also good practice to use lowercase or camelCase for variables and UPPERCASE for constants.
50  Using Arduino / Displays / Re: Problem getting 24 x 1 LCD display to work on: December 25, 2013, 03:31:30 pm
With single line displays they are are often internally configured as 2 line displays, so you could try initialising as a 12x2 display and may get lucky.

If not then it may simply be an unsupported controller chip.

EDIT: Seems it is a HD66717 controller so LiquidCrystal library will be unlikely to work. Some quick Google Fu turned up this; http://cratel.wichita.edu/blogs/jeffweide/2008/05/11/arduino-and-the-hitachi-lcd-display-driver/
51  Using Arduino / Project Guidance / Re: Talkie library + a little GLCD help on: December 25, 2013, 01:44:40 pm
You could also try SimpleSDAudio library, where you can record your sounds, convert using supplied batch files and Sox, then play straight from an SD Card with a speaker/amp connected to Arduino pin(s). 8 Bit Moni would work for voice for a clock.

All you'd neee is an SD card reader and a speaker + any required amp.
52  Using Arduino / Project Guidance / Re: Menu Recommendations? on: December 25, 2013, 07:40:54 am
Didn't even think to use keypad to avoid debounceing. (Great idea) If you post a link to controlling a menu over bluetooth send it to me, please. (Bluetooth is gonna be in next phase of project)
I will post a BT example as soon as I get a chance. I have my callback for MENWIZ looking for keypad or BT commands coming from Android App BTInterface (btinterface.com). It works perfectly as you can configure the BTI screen with just the buttons and labels for your app. Coupled with AT commands to initially configure name of the BT module and it all looks very custom.
53  Using Arduino / Networking, Protocols, and Devices / Re: sending nmea messages via nrf24l01+ on: December 25, 2013, 07:32:47 am
Only problem with that is you don't get every sentence and all the info. If you want NMEA at the other end, say to process with TinyGPS (++) then just basically routing serial to nRF would work.

If you only send certain info, and recreate into NMEA then ir's unneccessary work and also means modifying both lots of code if you want more info from the GPS stream.

In fact, thinking about terminators, you already have them in the form of <CR><LF> so you just need to send on by chunking into packets and stream the data across RF.
54  Using Arduino / Programming Questions / Re: TestGPRS code example from Arduino not working. on: December 25, 2013, 07:18:11 am
So what is your 'compatible'? Is it an ATMega328P chip? Does it have the Uno bootloader?

What is this 'compatible' board entry you are selecting?

Screenshots of your selection and a photo of your board would help immensly.

For most 'compatibles', selecting Uno is the appropriate option.
55  Topics / Home Automation and Networked Objects / Re: router on: December 24, 2013, 09:01:01 pm
An easy way to convert your Arduino ethernet to WiFi is to use a TP-Link WR702N Nano router in Client mode. You first connect it to your PC and join a wireless network, then you just connect your ethernet shield/module to it and you have a WiFi connection to the router signal you are 'borrowing' ;-)

You can pick up the WR702N on ebay for about £15.
56  Using Arduino / Project Guidance / Re: Add minutes to a GPS clock? on: December 24, 2013, 08:32:52 pm
How are you getting the time?

TinyGPS and TinyGPS++ allow you to pull the time and date out in it's component parts.

Just add 'x' to minutes and then do a check to see if you overflowed:-

If mins > 60, take away 60 and add 1 to hours
If hours > 24, take away 24 and add one to the day
Etc

Once you've done that then do whatever you need to do to display your clock.

If you only need time, no date, then it's pretty trivial to just check for overflowing minutes and hours.
57  Using Arduino / Networking, Protocols, and Devices / Re: sending nmea messages via nrf24l01+ on: December 24, 2013, 08:25:55 pm
The libraries for nRF are packet based (RF24 or Mirf) so you will have to buffer a NMEA sentence, chunk it into packet sized bytes and send.

I'd suggest adding a terminator character, which you can look for at the other end. Capture incoming packets and reassemble until you hit a terminator.

You will probably want to ensure you ACK each packet and retransmit if no ACK received.
58  Using Arduino / Microcontrollers / FIX: Software Serial not working on Bobuino based 1284/644 on: December 24, 2013, 06:16:51 pm
If you try to use Software Serial on an ATMega1284 or ATMega644 with the Bobuino pin mapping then you will encounter a compile error.

The Macro that defines the Pin Change Interrupt causes an issue with the way in which Software Serial converts the pins being used, into hardware port pin change interrupt masks.

The following changes to the Bobuino pins.arduino.h file will fix the problem and Software Serial has been reported as working successfully.

There is also a copy of the updated Bobuino pins.arduino.h file attached to this post.

*** No guarantee or warranty is given or implied. Please back up your original files before applying these changes ***

In variants/Bobuino/pins_arduino.h, at line 66, replace :-

Code:
#define digitalPinToPCICR(p)    ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3,(uint8_t *)0)
#define digitalPinToPCMSK(p)    ifpin(p,__pcmsk[digital_pin_to_pcint[]],(uint8_t *)0)
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7,(uint8_t *)0)

with

Code:
#define digitalPinToPCICR(p)    ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3, 0)
#define digitalPinToPCMSK(p)    (((p) <= 3) ? (&PCMSK3) : (((p) <= 7) ? (&PCMSK1) : (((p) <= 9) ? (&PCMSK3) : (((p) <= 13) ? (&PCMSK1) : (((p) <= 21) ? (&PCMSK0) : (((p) <= 29) ? (&PCMSK2) : (((p) <= 31) ? (&PCMSK3) : ((uint8_t *)0))))))))
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7, 0)

Save the changes and recompile, then test again with Software Serial and it should now work.
59  Using Arduino / Microcontrollers / FIX : INPUT_PULLUP error/not working on maniacbug 1284/644 cores on: December 24, 2013, 06:06:36 pm
The maniacbug mighty1284 core for ATMega1284, which can also be used on ATMega644, was before the introduction of INPUT_PULLUP to the Arduino core.

If you try to use

Code:
pinMode(pin, INPUT_PULLUP);

the compiler will throw an error to say that INPUT_PULLUP is not defined.

In order to fix this you need to change a few lines in two files. A copy of each of the amended files is attached to this post

*** No guarantee or warranty is given or implied. Please take a back up of your original files before making any changes ***

In the 1284/644 core file Arduino.h:-

From line 21, replace:-

Code:
#define INPUT 0x0
#define OUTPUT 0x1

with

Code:
#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2

In core file wiring_digital.c, in the pinMode function...

at line 35, replace:-

Code:
volatile uint8_t *reg;

with

Code:
volatile uint8_t *reg;
volatile uint8_t *out;

at line 41, replace:-

Code:
reg = portModeRegister(port);

with

Code:
reg = portModeRegister(port);
out = portOutputRegister(port);

at line 44, replace:-

Code:
if (mode == INPUT) {
uint8_t oldSREG = SREG;
                cli();
*reg &= ~bit;
SREG = oldSREG;
} else {
uint8_t oldSREG = SREG;
                cli();
*reg |= bit;
SREG = oldSREG;
}

with

Code:
if (mode == INPUT) {
uint8_t oldSREG = SREG;
                cli();
*reg &= ~bit;
*out &= ~bit;
SREG = oldSREG;
} else if (mode == INPUT_PULLUP) {
uint8_t oldSREG = SREG;
                cli();
*reg &= ~bit;
*out |= bit;
SREG = oldSREG;
} else {
uint8_t oldSREG = SREG;
                cli();
*reg |= bit;
SREG = oldSREG;
}

On completion of the changes to both files, test that INPUT_PULLUP now works:-

1) Wire an LED between any pin and Gnd, with a suitable resistor.
2) Set the pinMode as OUTPUT and digitalWrite HIGH to ensure the LED lights normally
3) Set the pinMode as INPUT and digitalWrite HIGH to ensure the LED lights dimly (old method of activating pullup)
4) Set the pinMode as INPUT and ensure the LED does not light
5) Set the pinMode as INPUT_PULLUP to ensure the LED lights dimly (new method of activating pullup)

If you compile OK and see the correct results for step 2 to 4 above then you now have INPUT_PULLUP functionality inserted into your 1284/644 core successfully..
60  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 24, 2013, 04:31:17 pm
That's what bvernham is using.

Excellent. Looks like we may have licked this one then.

I'll try and confirm if INPUT_PULLUP actually works as expected. I guess I could wire a Led between a pin and Gnd and it should light dimly if I set INPUT_PULLUP on that pin.

I'll then post a couple of 'fix' threads, with the relevant replacement files attached, for search posterity, if that sounds reasonable.
Pages: 1 2 3 [4] 5 6 ... 38