Show Posts
Pages: [1] 2 3 ... 11
1  Using Arduino / Programming Questions / Re: Extend the Serial class at compile time? on: October 24, 2012, 06:11:43 pm
Ideally I want to have Serial.printf()... but for starters I just want HelloWorld() as proof of concept.
2  Using Arduino / Programming Questions / Extend the Serial class at compile time? on: October 24, 2012, 05:35:08 pm
I'd like to add a HelloWolrd() method to the Serial class. I'm not familiar with C++ and extending a class so maybe someone can help with the syntax? I could edit the HardwareSerial code directly and just add the method, but that requires anyone else using my code to also do the same thing. I'd like to be able to say:

#include <scott_serial.h>

And have it extend and add the HelloWorld() method. That way I can just ship scott_serial.h with my project and not require people to modify their arduino supplied HardwareSerial.

Code:
class MySerial: public HardwareSerial {
  public:
    void HelloWorld();
};

void MySerial::HelloWorld() {
  Serial.println("Hello world");
}

////////////////////////////////////////////////

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
 
  Serial.println("hello");
  //Serial.hw();
  delay(1000);
}
3  Development / Other Software Development / Suggestions for improvement to the Linux IDE on: October 04, 2012, 01:01:18 pm
I love the Arduino platform, but it definitely has some warts. Especially the Linux version. Linux is all about hackers and coders, so a large portion of the Arduino audience uses Linux. All of these criticisms are based on running the Arduino 1.0.1 IDE on Fedora 17.


    Add Serial.printf()
  • printf() is a core part of a good C platform, and any good programming language
  • Having do multiple Serial.print() statements to print out some static text and then variable is a pain.
  • sprintf() is available for AVR, we just need to wrap it with the Serial object.
   Automatically open serial monitor after upload
  • I commonly have the serial monitor open to look at output. Hitting upload closes the window to complete the upload. A checkbox for "open Serial monitor after upload" would really cut down having to click two icons for every upload.
   Decouple the build process from the IDE
  • It would be great to have standard way to compile/upload to a board. This would allow easier use of an external text editor.
  • Vi/Emacs anyone?
  • There are some Makefiles out there that handle this, but none as clean as the IDE..
   IDE support for multiple simultaneous Arduinos
  • Working on a serial project to get two Arduinos to talk via serial required me to have two IDE windows open: client and server. Whenever I would change the board or USB port for one IDE window, it would change the other. This makes it very difficult to work on a two Arduinos as the same time.
   Auto detect serial ports on the fly
  • If I load the IDE before plugging in my Arduino it won't see the serial port in the menu. The only way to get it to pick up the port is to restart the IDE.
  • Often my Arduino Leonardo will switch from /dev/ttyACM0 to /dev/ttyACM1. When this happens the IDE doesn't detect that the port has changed, and the only way to switch to /dev/ttyACM1 is to restart the IDE.
   A better editor font
  • There are much better code friendly fonts that are easier to read. Can we add the ability to change the font?
  • Why are we not using anti-aliased fonts? Every modern OS uses them now.
       
        
4  Development / Other Software Development / Re: Custom syntax highlighting and dark UI on: October 02, 2012, 06:08:13 pm
Wow this looks really cool. Can you post some more information? Is it Mac only?
5  Development / Other Software Development / Re: runEvery (the next Blink Without Delay) on: October 02, 2012, 06:05:54 pm
On a technical level, I think this is pretty cool.
6  Development / Other Software Development / Re: New alternative IDE for Arduino on: October 02, 2012, 05:54:30 pm
This does look nice but I'd hold off doing too much work on it for a while. Firstly there are several other options now, some of which are pretty good. Secondly when the Due is released there is supposed to be a new IDE as well, that may well be a full-featured IDE and if it is and it's officially supported that would have to be the way to go.

What other Linux options are there available? I've seen Gnoduino, and had problems getting it to work. As far as a new IDE coming with the Due, I haven't heard that. I hope it's true. Where did you get that info?
7  Using Arduino / Microcontrollers / Re: After burning bootloader UNO won't take new code via USB on: October 01, 2012, 06:30:11 pm
I'll try it again tonight and let you know. How do I set SLOW_CLK on the USBasp? What does that even do?
8  Using Arduino / Microcontrollers / Re: After burning bootloader UNO won't take new code via USB on: October 01, 2012, 06:16:58 pm
Good question... I presume the Uno? How do you pick? I'm guessing it's just based on which "board" you have selected in the drop down?
9  Using Arduino / Microcontrollers / Re: Connecting Arduino Uno to a USB HID on: October 01, 2012, 03:45:23 pm
The USB port is treated as serial, IF you connect a device (USB master) that understands how to convert serial to USB signals. If your scanner is outputting RS232 you want to hook it up raw to pins 0 and 1 with appropriate voltage converters.
10  Using Arduino / Microcontrollers / Re: Program Ardunino Uno board via ISP connector. on: October 01, 2012, 03:33:05 pm
When you do an upload (not using a programmer) does that include the bootloader? Or is that section of the flash just not written when you upload?
11  Using Arduino / Microcontrollers / Re: avrdude + usbasp = "cannot set sck period" on: October 01, 2012, 03:25:57 pm
I picked up a 10 pin to 6 pin converter instead of trying to jumper direct to my board and now it works fine. I triple checked my pin outs, but obviously I missed something.

It's working now, thanks for the sanity check.
12  Using Arduino / Microcontrollers / After burning bootloader UNO won't take new code via USB on: October 01, 2012, 03:23:31 pm
I picked up a usbasp from Ebay for $4, and was playing with it and my Uno. I was able to upload code to my board via the IDE (upload via programmer), etc. Just for testing I did "burn bootloader" and after a long time it appears to have worked. It reverted to the standard "blink" sketch that comes on new Arduinos.

But now I can't upload any sketches to it via USB/Serial. The Uno is recognized by the OS, I get /dev/ttyACM0 but it won't take new code. It returns:

Code:
avrdude: stk500_recv(): programmer is not responding

every time I try and program it via USB. I also tried Windows, and I get the same thing. COM3 is detected, but it won't take code.

Do I need to reprogram the USB chip also? Can I do that with the IDE?
13  Using Arduino / Microcontrollers / Re: avrdude + usbasp = "cannot set sck period" on: September 17, 2012, 10:31:31 am
I looked in to that, and to upgrade the firmware requires another programmer. The last firmware available was release almost 18 months ago. I was just assuming/hoping that it would be semi-current.

Before I went down that road I wanted a sanity check that I was doing the right steps. I guess I could try Windows, to see if it works there?
14  Using Arduino / Microcontrollers / avrdude + usbasp = "cannot set sck period" on: September 17, 2012, 10:17:51 am
I picked up a (an?) usbasp from Ebay and I'm having problems getting it to program my Duemillinove.

Linux recognizes it, and the permissions are set correctly but when I try and use avrdude I get an sck error every time. I have the usbasp plugged in to my PC, and the pins mapped to the ICSP header on the Duemillinove. When I plug it in, the power light on the Duemillinove turns on, so I know I'm halfway there. When I run avrdude the TX/RX lights on my Duemillinove blink really quick and I get:

Code:
bakers@snikt(~)
:avrdude -c usbasp -p ATMEGA328P

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Is there a step I'm missing?
15  Using Arduino / Project Guidance / Re: Alarm system wiring advice? Am I pulling too much power? on: September 13, 2012, 12:04:18 pm
You lost me... the source of the power is the 5v bus. The digital pin is input mode, it should not be providing any power.
Pages: [1] 2 3 ... 11