Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 12
61  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.
62  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?
63  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.
64  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.
65  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.
66  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.
67  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?
68  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.
69  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?
70  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 15, 2007, 08:28:28 am
Great! It works!!
71  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)  
72  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.
73  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 08, 2007, 08:26:58 am
Quote
For a quick "hack" you need to add LCD4Bit.cpp to the CXXSRC variable in the makefile.  
Then in the .pde it must read #include "LCD4Bit.h" (no < >) to reference the lib as a local file. The last step is to put the LCD4Bit.h/.cpp in the same directory as the makefile and the .pde. Then it compiles -  at least in my case. smiley-wink
I see, but this is going to a mess after a while. If I change something in the LCD4Bit.cpp, where do I change it? I assume this has to be local, in the directory where the pde is? If you start a new program with the modified library you  have to  copy the library files to the new program directory.


74  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 08, 2007, 06:51:04 am
I tried to compile LCD4bitexample (from the playground) with the makefile from Oliver. But there are some errors:

applet/LCD4BitExample.cpp:4:21: error: LCD4Bit.h: No such file or directory
applet/LCD4BitExample.cpp:7: error: 'LCD4Bit' does not name a type
applet/LCD4BitExample.cpp: In function 'void setup()':
applet/LCD4BitExample.cpp:16: error: 'lcd' was not declared in this scope
applet/LCD4BitExample.cpp: In function 'void loop()':
applet/LCD4BitExample.cpp:28: error: 'lcd' was not declared in this scope
make: *** [applet/LCD4BitExample.elf] Error 1

It seems that LCD4Bit.h can not be found. What do I have to change so it will be found? I expect that all additional libraries will not be found.
75  Forum 2005-2010 (read only) / Development / Re: Arduino bundle for TextMate on: September 08, 2007, 03:11:35 am
xSmurf, could you upload the textmate bundle somewhere? I am still  in the evalutation period of textmate but it seems asa very good editor to me. Finally leaving vim behind me. (outside a terminal that is)
I just started using the arduino programmer as described on tinker.it. I expected that this programmer with textmate will make programming a lot easier.
Pages: 1 ... 3 4 [5] 6 7 ... 12