Loading...
  Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 13
61  Forum 2005-2010 (read only) / Interfacing / Re: Seperating bytes from Processing over serial on: September 22, 2007, 02:33:31 am
Why not send a line with x and y value and a newline character? So every line only has x and y value. Hmm, but you still need to separate on a space. Ok, the code below is a piece from a gps program. It replaces comma's with the 0's. So instead of one long string I have a bunch of strings after each other.

Code:
int gpsLine_size = strlen(gpsLine);
while((gpsLine[i]) && (i<gpsLine_size))
            {
              if(gpsLine[i] == ',')
              {
                commacount++;
                gpsLine[i] = 0;
                i++;
                  if (commacount == 1) timePtr = &gpsLine[i];
                if (commacount == 2) latPtr = &gpsLine[i];
                if (commacount == 4) lonPtr = &gpsLine[i];
              }
              else i++;
            }
In your case, if you have a space between the values you can replace this by a 0 and create a pointer to the next character. So, something like this:
Code:
xPtr = &xyline[0];
while( i< strlen(xyline)
{
    if (xyline == ' ')
    {
         i++;
         yPtr = &xyline[i];
     }
     else i++;
}
Just typed in the code, didn't check it. It is only for insipiration.  smiley
62  Forum 2005-2010 (read only) / Interfacing / Re: ArduinoBT using the CALL function on: August 30, 2007, 02:09:02 pm
Quote
Hey all,

at this moment I'm working on a tutorial with as topic using the ArduinoBT module.
In this tutorial I will show how to use commands like call, list, inquiry, select and close.

Can somebody tell me where I can post this tutorial?

Gr... Arjen

In the playground of course. But you have to make a new account for it. But please do. There is so little info about the arduino BT.
63  Forum 2005-2010 (read only) / Interfacing / Re: ArduinoBT using the CALL function on: August 30, 2007, 02:07:49 pm
Quote
hi bigengineer!

that thread is a great help. thanks!
But could you please confirm, that your SET-request program works on a standard configured arduinobt board?
On my board I see "+++SET+++" when starting the SET request. So the escape sequence is ignored and I don't get feedback.
Could you also confirm, that on an original configured arduinobt board, the escape seqeuence is enabled? I'm really wondering here, because in the arduinobt init sktech it says "SET CONTROL ESCAPE - 00 1" which means no escape sequence is enabled accroding to the iWrap user manual.
You are right, you have to change the SET CONTROL ESCAPE. You can use the init sketch for it. You can also  put in the setup() loop, but then you always have to wait for the delays.

Quote
Even when I'm direct (serial-usb) connected to the Bluegiga chip I don't get an output with "SET".
(And I also ran the Init Sketch to reset all original settings - just to be shure)
Maybe I screwed some setting up... (the ECHO command setting seems ok smiley-wink )
Strange, I have never tried it that way. But I think it should work. Do you get any respons from the BT? After a reset for instance?

Quote
Could someone please post the default output of the "SET" comand on arduinoBT?
I think this would be very good for the arduinobt documentation page.

How is this helpful you think? It only outputs some of the parameters.
64  Forum 2005-2010 (read only) / Interfacing / Re: ArduinoBT using the CALL function on: August 29, 2007, 11:18:04 am
check this thread . There is some example code to read the settings.
But if you use the hardware serial port to the BT module you can use the "SET" command directly to read out the settings. You can change the control echo mode so you can see what you type. Don't forget to change the control echo mode back to 0 otherwise your board will be useless.
65  Forum 2005-2010 (read only) / Interfacing / Re: eeprom download to Mac on: July 09, 2007, 02:03:01 pm
What about an example to get you started?
66  Forum 2005-2010 (read only) / Interfacing / Re: DS1822 and getting sensible numbers on: March 31, 2007, 12:49:55 pm
Great, it works!  smiley
Just one line of code:
Code:
temp = (8*lsb+12-data[6])*25/4;
where temp is the temperature*100, lsb byte 0 and data[6] byte 6 from the scratchpad.
67  Forum 2005-2010 (read only) / Interfacing / Re: DS1822 and getting sensible numbers on: March 31, 2007, 10:24:53 am
Hmm, I made a mistake: I read the wrong datasheet. Specifically the temperature accuracy is different between DS18S20 and DS18B20. I read the latter but I have the first.  >smiley-sad

Thanks for the link, that should be enough to get it working.
68  Forum 2005-2010 (read only) / Interfacing / Re: DS1822 and getting sensible numbers on: March 31, 2007, 02:57:57 am
For some reason I don't get the 12 bit precision from the DS18B20, according to the configuration register (byte 4) it should have 12 bit precision.
What I get is 0 for the MSB and 00101000 for the LSB at room temperature. If I bit shift LSB to the right once I get 20 C, that is more or less correct. But if I understand the datasheet correctly bits 0 to 3 are the extra precision bits and I should shift 4 bits to get a temperature without any precision. So, something like this should work but it doesn't.
Code:
int temp = 0;
temp = msb;
temp = temp << 8;
temp = temp | lsb;
temp =temp >> 4
For a temperature without any precision 1 shift right of the LSB is enough.
I don't get it, at the front page of the datasheet they speak about 0.5 accuracy, on page 3 they speak about 0.0625 accuracy.
69  Forum 2005-2010 (read only) / Interfacing / Re: DS1822 and getting sensible numbers on: January 25, 2007, 03:49:38 am
I have posted some code in the 1-wire topic http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1161557194. It is in the readscratchpad function. This code is just a copy of what is in the datasheets. If a DS1822 outputs the same numbers as a DS1820, I haven't checked.
70  Forum 2005-2010 (read only) / Interfacing / Re: processing takes over my serial monitor! on: January 07, 2007, 04:38:42 pm
No, this is not going to work. Today I had, by accident, processing and arduino listening to the same serial port. They both showed some output but incomplete. It looked like missing characters from arduino where visible in processing and vv. It toke me while to figure out that there was nothing wrong with the program. Processing was running on a different desktop so I didn't have both apps in 1 view. I am still suprised the OS didn't complain.

If you could  hook up more than 2 devices on a serial port how would you address each device?
71  Forum 2005-2010 (read only) / Development / Re: Library for TLC5940 16-channel PWM chip on: December 29, 2008, 03:36:20 pm
Quote

The UsingProgmem example sets all the LEDs at once.  If you want to turn on more than 1 LED, just use Tlc.set(channel, value);
Well, the UsingProgmem example doesn't work for me. And I tried this as a simple example:
Code:
void loop()
{
  int channel = 0;
  while (channel < 11)
  {
    Tlc.clear();
    Tlc.set(channel, 4095);
    Tlc.set(channel+1, 4095);
    Tlc.update();
    delay(500);
    channel++;
  }
}
No LED lights up. Should this work on USB power? Or do I need a powersupply. I don't remember using a powersupply with the older TLC library's but, again, it has been while since I played with it.
72  Forum 2005-2010 (read only) / Development / Re: Library for TLC5940 16-channel PWM chip on: December 23, 2008, 04:25:22 pm
It's been a while since I did something with an arduino. So, I might be missing something. Also, I haven't used this library before.
I try to get more than 1 led burning at a time. If I understand it right the "usingprogmem.pde" example should do this, right? but I don't see anything happening. The "basicuse.pde" example works, everything else seems to fail. What do I overlook?
73  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 15, 2007, 08:28:28 am
Great! It works!!
74  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 15, 2007, 04:52:07 am
I am still having trouble with the Makefile and libraries. The LCD4Bit works with the -I mentioned some posts above. But the twi lib doesn't work. In Wire.cpp I changed   #include "twi.h" to   #include "utility/twi.h" (line 24), this gets me a little bit further but it still doesn't compile. This is the make output:

Code:
applet/core.a(Wire.o): In function `TwoWire::begin()':
Wire.cpp:(.text+0x38): undefined reference to `twi_init'
applet/core.a(Wire.o): In function `TwoWire::begin(unsigned char)':
Wire.cpp:(.text+0x44): undefined reference to `twi_setAddress'
Wire.cpp:(.text+0x4a): undefined reference to `twi_attachSlaveTxEvent'
Wire.cpp:(.text+0x50): undefined reference to `twi_attachSlaveRxEvent'
applet/core.a(Wire.o): In function `TwoWire::requestFrom(unsigned char, unsigned char)':
Wire.cpp:(.text+0x76): undefined reference to `twi_readFrom'
applet/core.a(Wire.o): In function `TwoWire::endTransmission()':
Wire.cpp:(.text+0xae): undefined reference to `twi_writeTo'
applet/core.a(Wire.o): In function `TwoWire::send(unsigned char)':
Wire.cpp:(.text+0x10c): undefined reference to `twi_transmit'
applet/core.a(Wire.o): In function `TwoWire::send(unsigned char*, unsigned char)':
Wire.cpp:(.text+0x15c): undefined reference to `twi_transmit'
make: *** [applet/i2c_test.elf] Error 1

I made a very simple example:

Code:
#include <Wire.h>
void setup()
{
      
      
      Wire.begin();
      
      Wire.beginTransmission(0x1D);
      Wire.send(0x20);
      Wire.send(0x87);
      Wire.endTransmission();
      
}
void loop()
{
}

This compiles with the arduino IDE.  The modifications to the makefile:


ARDUINO = $(INSTALL_DIR)/lib/targets/arduino
ARDUINOLIBS = $(INSTALL_DIR)/lib/targets/libraries
AVR_TOOLS_PATH = $(INSTALL_DIR)/tools/avr/bin
SRC =  $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \
$(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \
$(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \
$(ARDUINO)/wiring_shift.c $(ARDUINO)/WInterrupts.c
CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/WRandom.cpp \
$(ARDUINOLIBS)/Wire/Wire.cpp
FORMAT = ihex


# Name of this Makefile (used for "make depend").
MAKEFILE = Makefile

# Debugging format.
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
DEBUG = stabs

OPT = s

# Place -D or -U options here
CDEFS = -DF_CPU=$(F_CPU)
CXXDEFS = -DF_CPU=$(F_CPU)

# Place -I options here
CINCS = -I$(ARDUINO) -I$(ARDUINOLIBS)/Wire -I$(INSTALL_DIR)/lib/targets/wiring
CXXINCS = -I$(ARDUINO)  
75  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 09, 2007, 01:10:56 pm
Slowly it is all coming back, -I, I can recall that, from a very long time ago.

I added an arduinolibs parameter, so, that is a bit easier to add, for instance:
CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/WRandom.cpp $(ARDUINOLIBS)/LCD4Bit/LCD4Bit.cpp

And I made a symbolic link to LCD4Bit.h in the sketch directory. After that I changed the avrdude config to work with my programmer. Now it works perfectly. So, command-R and command-U work, this is very nice for lots of uploads, it works very quick.
Pages: 1 ... 3 4 [5] 6 7 ... 13