arduino ide 可以使用C语言吗?-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 407|回复: 2

[未解决] arduino ide 可以使用C语言吗?

[复制链接]
发表于 2022-7-18 18:11 | 显示全部楼层 |阅读模式
如果可以的话 该怎么使用C语言呢?
发表于 2022-7-18 19:43 | 显示全部楼层
arduino开发就是使用C/C++
发表于 2022-7-19 01:21 | 显示全部楼层
可參考範例檔案,例如最基礎的 BLINK:
  1. /*
  2.   Blink
  3.   Turns on an LED on for one second, then off for one second, repeatedly.
  4.   Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  5.   it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  6.   the correct LED pin independent of which board is used.
  7.   If you want to know what pin the on-board LED is connected to on your Arduino model, check
  8.   the Technical Specs of your board  at https://www.arduino.cc/en/Main/Products
  9.   
  10.   This example code is in the public domain.
  11.   modified 8 May 2014
  12.   by Scott Fitzgerald
  13.   
  14.   modified 2 Sep 2016
  15.   by Arturo Guadalupi
  16.   
  17.   modified 8 Sep 2016
  18.   by Colby Newman
  19. */


  20. // the setup function runs once when you press reset or power the board
  21. void setup() {
  22.   // initialize digital pin LED_BUILTIN as an output.
  23.   pinMode(LED_BUILTIN, OUTPUT);
  24. }

  25. // the loop function runs over and over again forever
  26. void loop() {
  27.   digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  28.   delay(1000);                       // wait for a second
  29.   digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  30.   delay(1000);                       // wait for a second
  31. }
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-1 01:26 , Processed in 0.187642 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表