compiling C code

i'm totally noob to programming but i found a project that i really interested and decided to build it but currently stuck on the compiling and flashing the program to atmega 328p. can anyone help me please ?

this is the project that i want to make BMW IBUS Bluetooth
thanks.

If you want help with a program you need to post your code.

If you are getting an error when you try to compile the program please also post the error message

...R

Hi,

What is your electronics, programming, Arduino, hardware experience?

The project looks quite advanced for a totally noob.
It looks like there is some extra hardware to be built.

Tom.... :slight_smile:

If you want to replicate that project then you need the hardware the project uses.

Hardware

/bmw_bt_cdcemu_digital/ - KiCAD digital board. Contains the IBus transceiver, BT module and Atmega328p microcontroller
/bmw_bt_cdcemu_analog/ - KiCAD analog board. Contains the differential to single ended amplifier and power line filtering with power off functionality controlled by EN12 pin on the digital board

i did build the hardware. currently struggling to compiling the original software. i cant open it on arduino ide. i downloaded the atmel studio too but cant seems to open the project and compile it.

Post your error messages and code

noweare:
Post your error messages and code

problem is i dont witch program to use to even open it.i did try with atmel studio but cant seems to open entire project only single file. code is on the github page firmware folder.

Hi,
What file are you trying to open, for Arduino IDE it will be .ino extension, or if older .pde extension.

Tom.... :slight_smile:

You could use a simple text editor - gedit, nano, Notepad, Notepad++ . . .

Are you saying you haven't even tried to compile this code yet?

The firmware files are .c and .h. The OP doesn't know (nor do I) how to be able to compile the code for Arduino (specifically Mega328p).

Hi,
Apart from the github where else did you get information on this project.

The github site only gives hardware details and bluetooth firmware.
I cannot find any Arduino base code.
There is reference to 328 but not to Arduino from what I can see.

Tom... :slight_smile:

Code is for the atmega328p but in c and h format and i dont know how to open the complete project to compile it.
There is a YouTube video on it.

Also posted at:

Do this:

  • Download https://github.com/the-vty/bmw-ibus-bluetooth/archive/master.zip
  • Unzip the downloaded file.
  • Open the bmw-ibus-bluetooth-master/firmware folder from the unzipped project.
  • Create a file named firmware.ino. Assuming you’re using Windows (since you mention Atmel Studio), you only need to right click > New > Text Document, then change the name of the generated .txt file. Make sure the file is named firmware.ino, not firmware.ino.txt. Windows likes to hide file extensions by default.

That dummy .ino file will allow the Arduino IDE to open the project as a sketch since the Arduino IDE requires at least one .ino file in every sketch, although the .c and .h files used in this project are also supported. After doing this I was able to successfully compile the sketch for Arduino/Genuino Uno using the Arduino IDE. I don’t know whether it will actually work but I don’t see any special magic in the Makefile so I think there’s a good chance that it will.

Hi,
If i was you I would be getting onto Aplejohn.

From what I can see of the video, he/she likes to show how things work but are a bit short handed when it comes to publishing any proper documentation on how anyone else can do it.
Okay you have some code and PCB layouts and circuit, but if they don't tell you how to load what software, its a bit of a loss if you don't know where to start.

Pity because of the amount of effort and coding that must have gone into the project.

Just to have his/her smarty phone controlled from the steering wheel buttons.

Tom..... :slight_smile:

Thanks it works !!! :slight_smile:

Glad to hear it. It would be helpful if you added a comment to your issue report with a summary of the steps needed to use the project with the Arduino IDE (or just a link to my instructions if that's all that was necessary). Even if the author of the project decides they don't want to support usage with the Arduino IDE, others with the same question may be helped by finding that information in your issue report.

yes i will update it. and also make pcb schematics using fritzing to make it easier to work.

raku5200:
yes i will update it. and also make pcb schematics using fritzing to make it easier to work.

Nooooooo.. do not use Fritzy....
Use either a CAD program or pen/pencil and paper.
Tom...... :o :o :o :o :slight_smile:

Raku5200,

Would like to see your notes on how you got it working. Fritzy is better than nothing.

Thanks,