Pages: 1 ... 4 5 [6] 7 8   Go Down
Author Topic: CodeBlocks Arduino IDE - real C++ IDE for Arduino development (rev.20130827)  (Read 58859 times)
0 Members and 1 Guest are viewing this topic.
Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you choose the board type?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Stanley, board is selected properly in Codeblocks and in Arduino builder (mega2560).

It works ok, if I compile, build in Codeblocks and then manually start Arudino builder, choose hex file manually and upload.

I guess something is wrong in codeblocks porting to arduino builder, but all is original settings, I tried some alterations, but no success, then I owerwrite it with original.

Damo
Logged

Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So error only occurs when you use Arduino Builder manually?
I recommend downloading a complete Arduino Builder if you want to use it manually.
http://www.downloadbestsoft.com/Arduino-Builder.html
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, when I use it manually it works ok.

When it is called from codeblocks error happens.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

me again smiley.  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!
« Last Edit: July 23, 2013, 09:02:17 am by damo1023 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

TIA,

Fernando.

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:
Code:
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
}
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?
Logged

Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.


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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Los Alamos
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

.

Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 12, 2013, 10:04:30 pm by microcat » Logged

Los Alamos
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!! smiley-cool  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..... smiley-roll-sweat

Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 22, 2013, 04:57:07 am by Swpolo » Logged

Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: 1 ... 4 5 [6] 7 8   Go Up
Jump to: