CodeBlocks Arduino IDE - real C++ IDE for Arduino development (rev.20130827)

Hello,

me again :). Stupid windows 7, I think from XP they are getting worse and worse.

I solved the problem - project shouldn't be in the c:\users folder!

Ok, and how do you recompile-rebuild so that the hack starts to work?

TIA,

Fernando.

stanleyhuang:
Actully my long-term goal is to implement a simulator which acts like a http server and use HTML to render the simulation.
About hacking into arduino core files, taking digitalWrite as an example, I just added one line at the end like this:

void digitalWrite(uint8_t pin, uint8_t val)

{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t *out;

if (port == NOT_A_PIN) return;

// If the pin that support PWM output, we need to turn it off
// before doing a digital write.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);

out = portOutputRegister(port);

uint8_t oldSREG = SREG;
cli();

if (val == LOW) {
	*out &= ~bit;
} else {
	*out |= bit;
}

SREG = oldSREG;

#ifdef ARDUSIM
    fprintf(stderr, "[MCU] Pin %d state changed to %s\n", pin, val ? "HIGH" : "LOW");
#endif
}





> tianshuo:
> I see them alright, but I'm not sure where should I start from. I guess maybe the simulator could listen to a port for signals?
> Could someone give an example using wiring_analog.c?

The simulation code is in the core files (a different version). There is no need to rebuild. It is built and linked with sketch.

@stanleyhuang:

Hmmm... if this is a reply to my question, maybe I didn't ask it in the right way. I was asking about your suggestion for hacking the simulator by using code inside

#ifdef ARDUSIM
...
...
#endif

which actually I did. However, when I open the ardusim.cbp with the Code::Blocks you provide I obtain a lot of errors (I could send the compiler-linker report, just ask). I've finally got to simulate a digital pin input from file, but doing some extra-hacking stuff, which I prefer not to send, since I think I'm doing something wrong with ardusim.cbp and I would like to fix it.

TIA,

Fernando.

stanleyhuang:
The simulation code is in the core files (a different version). There is no need to rebuild. It is built and linked with sketch.

Newbie here...testing driving the Arduino CB IDE...how does one send a command/message via the Arduino Builder serial interface??? I can upload the sketch successfully, and can open a serial port at the desired baudrate, but how do I send a command to the Arduino??? Serial.print()?
I am working on a exercise where you instruct RGB LED's to turn on to a set level....using the serial interface in Arduino IDE I can successfully change the LEDs but at a sticking point via the CB Arduino IDE...thanks.

Stan -

Great work on the Code::Blocks for Arduino. I had some difficulty getting the software to work on Windows 7 at first, however I was able to find a work around. Here is was my original problem. When I try to do a "build and run" from Code::Blocks for the blink example, the Arduino Builder pops up. Afterwards, I click COM3 but it gives me the following message: "Error generating HEX file."

My alternative solution was this. I did a "build" only using the blink example. Afterwards, I open the Arduino Builder, click Load Sketch / HEX and then click COM3. This solution worked. Although this solution is a bit slower, it still works. Do you have any suggestions/ideas why the build and run is not working from the Code::Blocks IDE?

On another note, I am attempting to get the CB for Arduino to work on Ubuntu 12. No luck so far but I will let you know if I have anymore luck.

Ok, pretend I'm new at this.
I downloaded the file CodeBlocks-Arduino-20130827.7z now what do I do with it? It's not an a Plugin, but it's not going to install it's self either. I see people taking about having just installed it. I though it would be a plugin for CodeBlocks... Help, I want in on the fun

Am I just getting to the wrong file?

.

Hi chj_sullivan,

The ".7z" extension on the file name means it has been compressed with 7-Zip. You will need to locate, download, and install 7-Zip in order to decompress the file. What to do next depends on what you get after the decompression. If it is only a couple files, one having a ".exe" extension, then it has an installer. Just run the file with that extension and a wizard will guide you through the process. If instead you end up with hundreds of files in a dozen or more directories folders, then this is the actual program, and you just need to move it to a convenient location where you have read/write access. I don't remember which it is as it was a while ago that I tried it. I should also mention that this is a complete Code::Blocks package, not just a plug-in. Hope this helps.

microcat:
Hi chj_sullivan,

The ".7z" extension on the file name means it has been compressed with 7-Zip. You will need to locate, download, and install 7-Zip in order to decompress the file. What to do next depends on what you get after the decompression. If it is only a couple files, one having a ".exe" extension, then it has an installer. Just run the file with that extension and a wizard will guide you through the process. If instead you end up with hundreds of files in a dozen or more directories folders, then this is the actual program, and you just need to move it to a convenient location where you have read/write access. I don't remember which it is as it was a while ago that I tried it. I should also mention that this is a complete Code::Blocks package, not just a plug-in. Hope this helps.

microcat,

Thank you!! 8) Been using C::B for school. Taking beginners C as par of my freshman classes, and to improve my projects, most of the class uses MSVS, C::B is much smoother and easier to use. When I saw Stanley's offering I was stoked!! Best of both worlds. Embarrassed about the .7z thing though. Doh!
Now to see if I can use my FTDI Basic..... :cold_sweat:

rsk22:
Stan -

Great work on the Code::Blocks for Arduino. I had some difficulty getting the software to work on Windows 7 at first, however I was able to find a work around. Here is was my original problem. When I try to do a "build and run" from Code::Blocks for the blink example, the Arduino Builder pops up. Afterwards, I click COM3 but it gives me the following message: "Error generating HEX file."

I had the same issue and I found the cause was the file path.
I had a "-" in the path and when I removed it, the problem was solved.
"space" in the path is also a error generator.

Original path : C:\DEV_ELEC\Paul - Arduino\Programme_test\V2 - fonctionnel
=> error hex
Fixed path : C:\DEV_ELEC\Paul\Programme_test\V2_fonctionnel
=> Works

Hope my message is understandable
Paul

I remember I have fixed a similar issue in the latest version. Which version are you using?

stanleyhuang:
I remember I have fixed a similar issue in the latest version. Which version are you using?

20130827, the last one according to Sourceforge.

But I work on two computers and only one of them has the problem.

is it possible to add Arduino compatible boards to the IDE build target?

like this one e-Gizmo Technical Blog: Patch Files to Add gizDuino in Arduino IDE Board List Menu (Updated October 1,2016)
a patch file to be copied in the Arduino IDE installation folder that will add compatible boards and appear to the Arduino IDE>Board list

Hi:

Pretty noob here.

I am having a problem uploading the sketch to the Arduino. I compile in C:B, start the Arduino builder, select the com port and the builder does it's thing. The last line in the window is "error linking objects" and the error message I get when it tries to send is "upload not successful, error code -5"

The only libraries I am using is Arduino.h and AFMotor.h, and the sketch compiles with no errors/warnings in C:B.

I am using Code:Blocks for Arduino, version 12.11. I am using Arduino builder v0.8.6 on Windows 8.

It's obviously looking for something that it's not finding, but I don't know what. Any help would be appreciated.

Thanks!
Scott

stanley-

Great project, great idea! The Arduino IDE is lacking in several aspects, I'm not a fan. However for my current project I am building a custom board, so I need the ability to define this board (in the typical Arduino way), then have it appear in the menu selection list so that I can download sketches to it. Is there any consideration to implementing such a feature?

Thanks!

greetings.
I have a problem whit the arduinobuilder. An error appears that there is a error starting the arduinobuilder .
Is some one else having this to? An how can i fix it ?
Best regards Ben

This is a wonderful upgrade from the standard arduino IDE, thanks for putting in all the effort.
Of course, I do have an issue :wink:
I've used this tool on several machines and it work great, but on my "kinda" main desktop machine it doesn't find the COM port the arduino is connected to (using an Uno). The standard arduino IDE works fine and the command line ArduinoUploaders works fine but ArduinoBuilder doesn't see any COM ports. I tried setting up a dummy project where I told it the port to use and that made no difference. Any ideas what I might try? Is there a setting I'm missing?
I can just keep a command prompt open for uploading code but I'm curious what's going on
Win7 64 bit

Once again, thanks for such a nice tool
Dave

Hi! is there a code block arduino version for mac? i can't seem to find it on the webpage
thanks

It is out of work accidentally, it could compile the project and have problems in generating HEX file

Once I have pasted the official liquid crystal example?hello world into the code blocks?error? 'millis' was not declared in this scope?so i added ‘#include "Arduino.h"successfully made it.But I found you have a customed folder Liquid Crystal and it has the *cpp too.Maybe the problem is in your cpp file.????????????????????????? :stuck_out_tongue: