Giter VIP home page Giter VIP logo

Comments (8)

FASTSHIFT avatar FASTSHIFT commented on July 21, 2024

@kehale
测试一下delay函数正不正常。
millis不对可能是主频不正常导致的,可以进入debug查看SystemCoreClock(主频)的值。
您用的是什么型号的芯片,晶振的频率是多少?

from arduino-for-keil.

kehale avatar kehale commented on July 21, 2024

delay 完美运行 就是millis 我的芯片stm32f030,主频48的。这个 和外部晶振8M没有关系吧,谢谢了。

from arduino-for-keil.

kehale avatar kehale commented on July 21, 2024

批注 2020-04-03 133440
批注 2020-04-03 133455
批注 2020-04-03 133511
我外部用的8M晶振,这个晶振设置没问题,delay准确没问题。还有那个SystemCoreClock(主频),我在debug怎么找不到呢?麻烦给个截图 ,谢谢

from arduino-for-keil.

FASTSHIFT avatar FASTSHIFT commented on July 21, 2024

image
进入debug调试界面,在Watch窗口里输入SystemCoreClock,就可以看到主频了。
delay正常,说明主频是正常的,应该是你写的部分出了问题。
如果实在解决不了的话加我Q吧,个人主页那个邮箱就是。

from arduino-for-keil.

kehale avatar kehale commented on July 21, 2024

好的,能给我一下你写的millis()代码吗?我测试下 谢谢 主要是新手,感觉这个keil arduino非常好,

from arduino-for-keil.

FASTSHIFT avatar FASTSHIFT commented on July 21, 2024

#define LED_Pin PC13
#define LED_FlashTime 1000

static uint32_t lastTime = 0;

void setup()
{
pinMode(LED_Pin, OUTPUT);
}

void loop()
{
if(millis() - lastTime >= LED_FlashTime)
{
lastTime = millis();
togglePin(LED_Pin);
}
}

from arduino-for-keil.

jackliuwenli avatar jackliuwenli commented on July 21, 2024

你好,大佬,可以建个QQ交流群吗?找不到组织啊~

from arduino-for-keil.

FASTSHIFT avatar FASTSHIFT commented on July 21, 2024

@jackliuwenli
私聊我就行,QQ在我的个人主页

from arduino-for-keil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.