[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>tfw finish my simple home automation project What's

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 29
Thread images: 2

File: arduino_official_Logo__.png (2KB, 230x175px) Image search: [Google]
arduino_official_Logo__.png
2KB, 230x175px
>tfw finish my simple home automation project

What's the best IDE for arduino? getting tired of the default one

Also can i use #define in place of const char*?
>>
>>61834851

Just install avr-gcc and write for the arduino in C, there is more control.
>>
>>61834851
Correct me if I'm wrong but I thought Arduino was just using a modified/stripped C. Can't you just use any text editor plus the compiler?
>>
>>61834851
Arduino still alive in 2017?
LMAO, what you do? A 3x3 led cube and call it a masters project?
>>
>>61835200
something to do with load cell and solenoid valve for myself
>>
>>61835349
HAHAHA calm down Elon musk
>>
>>61834869
You mean still writing the ".ino" with the setup and loop but compiling by hand in the command line?
>>
>>61834851
Visual Studio or Visual Stuido Code
>>
>>61834851
Platform.io is the best for arduino by far
>>
>>61835634
http://platformio.org/frameworks/arduino
>>
>>61835400
No, you write actual C. There is still a loop though. Here's an example:

#include <avr/io.h>
#include <string.h>

#define F_CPU 16000000
#define BAUD 9600
#define BAUD_RATE_CALC ((F_CPU / 16 / BAUD) - 1)

void
serialsetup(void)
{
/* high - low bits */
UBRR0H = BAUD_RATE_CALC >> 8;
UBRR0L = BAUD_RATE_CALC;

/* enable transmission and recieve */
UCSR0B = (1 << TXEN0) | (1 << TXCIE0) | (1 << RXEN0) | (1 << RXCIE0);
UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);
}

void
serialmessage(char *message)
{
int i;

i = 0;
for (i = 0; i < strlen(message); ++i) {
while ((UCSR0A & (1 << UDRE0)) == 0);
UDR0 = message[i];
}

UDR0 = 0;
}

int
main(void)
{
serialsetup();
serialmessage("init\r\n");

for (;;)
{
}

return 0;
}
>>
>>61835734
What's the difference between writing it in C or "into"?
Does the former looks more similar with what I might find outside the arduino world?
>>
>>61835917
Yes, C (and sometimes assembly language for machines with weird ISAs) is used to program most microcontrollers.

You won't really see Arduino's language outside of Arduino. If you end up making your own PCBs you'll want to know how to use C and that controller's assembly language.
>>
>>61835992
>>61835917
Oops, didn't answer your first question. The two languages aren't too different; but you'll run into barriers if you try to do too much in Arduino. The main difference between Arduino and C is that Arduino has quite a few abstractions on top of what is actually going on in the hardware. This has a few pros and cons: you have less control, but it is generally easier to write trivial programs.
>>
>Arduino is a language
>C for microcontrollers in 2017

Don't listen to anyone in this thread OP.
Protip: Arduino is C++ and a few helper libraries. And nobody uses C for this anymore, it's all C++ now.
>>
>>61836027
Thanks. I've read the avr tutorial on hackaday, I understand what's going on (at this beginner level) but I find it quite non intuitive.
Maybe I'm too much used to what C code looks like on other subfield of CS
>>
>>61836121
C++ for microcontrollers looks almost identical to C anyways, there is no point.

>>61836141
Yeah it's quite a bit different than normal C because there is quite a bit of architecture-dependent things going on and actual hardware interaction.
>>
>>61834851
>retarduino

HAHHAHAHAHAHAHAHAHAHHAHAHAHAHHAHAHAHAHAHAHHAHAHAHHAHAHAHAHAHHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHA
>>
>>61834851
>>>/toy/
>>
>>61836245
>>61836271
(You)
>>
>>61836192
>there is no point

Mercedes' ECU development team seemed to disagree 5 years ago. Not that I'd expect a unemployed /g/ regular know what happens in the real world.

RAII and class member functions alone are reason enough. Sane libraries and stricter type checking are just topping.
>>
>>61834851
>arduino

You must be over 18 to post here
>>
>>61835634
This. Use Platformio, OP.
All other suggestions are posturing and dick-wagging, use this to get shit done instead.
>>
>>61836380
>Sane libraries
I think that's more on those who make libraries. You can perfectly make good libraries in C. The problem is, making a good public API is an art not many wield. That reminds me of a certain lib I had to use to interface with a certain device some time ago.

>HANDLE libname_open_ex(void *data1, void *data2, int flag)
>the exact meaning of data1 and data2 is derived from the value of the flag
They could simply divide it into four different functions (libname_open_someid, libname_open_someotherid etc), but no, we are afraid of polluting the symbol table of our dll.
>>
>>61834851
Personally I prefer ARM boards for applications that need a tad more power (useful in home automation), for smaller endpoints AVR is sufficient, I recommend C/ASM see >>61834869
>>
>>61836424
>>61835634
>>61835649
>Platformio

reddit plz go
>>
>61836584
>posturing and dick-wagging
>>
VS code with Arduino plug in, by far best Arduino IDE
>>
File: 1483830474823.gif (3MB, 500x540px) Image search: [Google]
1483830474823.gif
3MB, 500x540px
Vim + Arduino-Makefile

https://github.com/sudar/Arduino-Makefile
Thread posts: 29
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.