Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Microcontrollers / Re: Atmega168 in standalone mode -please help on: February 17, 2014, 03:23:02 pm
If you've popped the chip out of the Arduino board (as I suspect you may have done, given the edge of the board and that screwdriver in your picture), you will also need to have an external 16MHz crystal with appropriate load capacitors, and a pull-up resistor to pin 1 (the !Reset pin) for the chip to start running code.
2  Using Arduino / General Electronics / Re: I2C pull-ups resistors. on: February 05, 2014, 04:17:31 pm

Did some poking; this is the current link: http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors

I suppose I'll add some resistors after all. :x

3  Using Arduino / Programming Questions / Re: Random numbers to char array?? on: February 05, 2014, 10:34:29 am
If you check out the ASCII entry on Wikipedia, it will explain why the first example produced random garbage, while the one that adds 48 to everything produces actual numbers.

The characters displayed on your screen are actually mapped to different numbers in the ASCII character set. Numbers less than 31 are used for controlling data streams, and contain things like the null character '\0', carriage returns '\r', newlines '\n' and other stuff. The characters that actually print numbers start at an integer value of 48 for '0', which in C++ is not the same as 0.
4  Using Arduino / Programming Questions / Re: Including interrupt routine in library on: February 05, 2014, 10:26:10 am
Make sure that you're declaring milliSeconds in a more general scope (not inside any functions, or in your OpenDeck class) before you use it in any functions.
5  Using Arduino / General Electronics / Re: I2C pull-ups resistors. on: February 05, 2014, 10:23:15 am
I'm using the I2C bus without any external pull-up resistors and 3 devices attached, and not having any problems. The mcu's internal ones seem to be doing fine.
6  Using Arduino / Programming Questions / Re: what does "this->variableName" mean on: February 03, 2014, 01:34:47 am
It's one way C++ allows you to access member variables (variables that are part of an object). "this" is actually a pointer to the object's current location in memory (in this case, of type Stepper*), so doing "this->(some variable)" is one way to get the value of (some variable).

If you open up the corresponding header file, probably Stepper.h, you'll see each variable that comes after the "this->" declared in the class body.
7  Community / Local Groups / Re: Arduino Training / Events around Vancouver BC & Fraser Valley? on: February 01, 2014, 11:49:32 pm
I might be interested in something if there was one nearby. (:
8  Using Arduino / Programming Questions / Re: can't break out of a while loop? on: February 01, 2014, 07:20:26 pm
Check out the String library reference for toInt: http://arduino.cc/en/Reference/StringToInt

You'll want to be careful and do check for bad data when converting. smiley-wink
9  Using Arduino / Programming Questions / Re: can't break out of a while loop? on: February 01, 2014, 07:00:07 pm
If you're reading a text file and are looking for the symbol 8, you'll want to do:

Code:
if ((peek_char) == '8')

instead. Note the presence of quotes - this tells the compiler you're comparing against a symbol 8, not the number 8 (which as a character in a text file is a non-printing character (that is, it isn't associated with a number or character as you and I think of them) ).
10  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: LCD Library on: April 25, 2008, 01:04:12 pm
Quote
what would happen then if I have a 2 line lcd and i did
LCD.println("A");
LCD.println("B");
LCD.println("C");

would the last line roll off and lcd  showing

A
B

or would it scroll up showing

B
C

or would it wrap around to the top showing

C
B


In this case, I think the C would get lost, as the chips in a 16*2 LCD don't have memory for more than 2 lines and 0x27 characters per line. If the characters are printed off the screen, they do not get printed, but instead remain in the driver's DRAM. If the LCD received commands to scroll the text, then these hidden characters would start appearing on the screen.
Ultimately, it would depend on how the function was implemented.
11  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Spammers on: April 22, 2008, 06:49:37 pm
Does YaBB keep track of poster's IP addresses? We could start blocking ranges of repeat offenders.
12  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: stdio.h in 0011 broken on: April 01, 2008, 12:53:04 pm
Seems the discussion's mostly over here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206744591/6#6
13  Forum 2005-2010 (read only) / Bugs & Suggestions / stdio.h in 0011 broken on: April 01, 2008, 12:45:02 am
Something seems to have been changed in Arduino 0011, and apparently has broken the AVR stdio.h. The code still compiles in 0010, but gives errors in 11. I thought it might be the order of includes, so I rearranged mine some, but didn't do anything. My sketch needs it for some sprintf junk.

Quote
c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected unqualified-id before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected `)' before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected `)' before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected unqualified-id before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected `)' before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected `)' before 'int'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: '__put' was not declared in this scope


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'char'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'struct'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: '__get' was not declared in this scope


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'struct'


c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: initializer expression list treated as compound expression

If you want my sketch code as well, just holler.
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: get the length of an Array on: June 17, 2008, 01:05:02 pm
One thing to note about the sizeof function is that it will not work on arrays not defined at compile time.

char * arr;
arr = new char[10];
int size = sizeof(arr);

size will contain 2, which is the size of a char *.

The arr.length() function you speak of doesn't exist in C++. Java and other languages actually build a class around the array to provide the programmer with all these handy little functions, and also provide some bounds-checking as well, preventing you from accidentally doing arr[10] when the array is only 10 items long. It is possible to create a 'wrapper class' in C++ to get these nice features, but you have to use it explicitly.
15  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to access TCNT1 (ATmega168)? on: May 01, 2008, 09:53:43 pm
Include avr/io.h and then you can read/write directly to TCNT1, like so:

TCNT1 = 0;
Pages: [1] 2 3 ... 5