Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
7
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Servo Library, can I address servos dynamically?
|
on: March 14, 2010, 11:23:28 pm
|
|
Without seeing the rest of the code, I can't figure out what you're trying to do.
The compiler did not yell at you on the switch and case, so I presume ch is really a char and not a Servo object.
That is why the compiler pukes on ch.write. Unlike a Servo object, a char is not even an object and therefore it does not know how to write itself.
You probably meant something like this: Servo myServoArray[4];
myServoArray[ servoIndex ].write(v);
If you post more complete code, we can try to help you further.
|
|
|
|
|
9
|
Forum 2005-2010 (read only) / Bugs & Suggestions / BUG: Serial Monitor keyboard shortcut inserts CR
|
on: March 08, 2010, 10:43:49 pm
|
|
I noticed that sometimes the Arduino IDE would randomly destroy my code in the editor. It could be as harmless as changing number of spaces between functions, or as bad as renaming my variables or missing code chunks.
It turned out that everytime I press the Serial Monitor keyboard shortcut: CTRL+SHIFT+M
Not only the Serial Monitor would open, but Arduino IDE also types a Carriage Return character WHEREVER my selection happens to be! If I have code selected, it would be removed and replaced with a return.
Not cool... :-(
I'm running Arduino 0018 on 32-bit Windows Vista Ultimate.
|
|
|
|
|
10
|
Forum 2005-2010 (read only) / Bugs & Suggestions / Feature request: Keep Serial Monitor open
|
on: February 04, 2010, 01:43:11 pm
|
|
I presume the reason the IDE automatically closes Serial Monitor window is to shield us from seeing all the scary bits going in/out from/to the Arduino.
It would be nice, however, if IDE would automatically re-open the Serial Monitor window when upload is done, or better yet, keep the window open but disable the textbox and buttons during uploads.
Not that big a deal now there's a keyboard shortcut (Ctrl+Shift+M) to re-open Serial Monitor, but it would be nice to have the Serial Window remain open during the debugging cycle.
|
|
|
|
|
11
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Looking for enum and .h guidance
|
on: March 09, 2010, 09:19:31 pm
|
|
Hi, I tried putting both transmitter and receiver pde in one folder. IDE yelled at me for having two setup(). :-(
I think I will stick with const and just maintain them in both pde. I need to accept that in embedded programming I cannot code defensively.
Thanks for your suggestion.
|
|
|
|
|
12
|
Forum 2005-2010 (read only) / Syntax & Programs / Looking for enum and .h guidance
|
on: March 09, 2010, 02:16:14 am
|
I got enums to work after reading this: http://www.arduino.cc/playground/Code/EnumBut, I still have questions :-? 1. So far, I've been creating new .h elsewhere with NotePad and then adding it to my sketch folder via Sketch > Add File... which would more it to the correct place and make it visible as a tab. Is this really the best way?! 2. I'd like to share enum between two sketches (one is a transmitter, the other a receiver). How do I do this without duplicating the .h ? Creating a library seems overkill for a very specific enum. 3. Would I be better off combining both sketches and set a #define to choose whether to compile the transmitter or receiver?
|
|
|
|
|
13
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Need help with error code
|
on: February 17, 2010, 09:16:43 pm
|
|
Just a simple typo: You need parentheses when defining functions even when they have no parameters, so you need setup() and loop().
There is also a typo on the last two lines of setup(), ledpin12 and ledpin13 are mistyped. Computers are picky that way. ;-)
|
|
|
|
|
15
|
Forum 2005-2010 (read only) / Interfacing / Re: Arduino Duemilanove and VirtualWire
|
on: March 10, 2010, 12:23:46 am
|
|
I have that RF pair and here is a snippet from my sketch that I know works: char *msg = "012"; msg[0] = x; msg[1] = y; msg[2] = dir; vw_send( (uint8_t *)msg, strlen(msg));
As you can see I am sending three characters, to send just one you can modify it like this: char *msg = "0"; msg[0] = PWMVAL; vw_send( (uint8_t *)msg, strlen(msg));
As far as the garbage characters, make sure that the baud rate selected at the bottom right of the Serial Monitor window matches the one you specify in Serial.begin(9600);
|
|
|
|
|