欢迎来到PSOCS的迷人世界!
乍一看:
I2C是中断驱动的,因此必须启用全局中断。
在这里上传完整的项目总是明智的,所以我们都可以看看。要做到这一点,在创建者“文件& GT;创建工作区束(最小)”,然后上传由此产生的档案。
对于新手来说,C语言和编程通常也是个问题。当项目增长时,它变得越来越复杂,所以当你早点开始把它分成更小的部分时,它会对你有所帮助。因此,您的主体()可能看起来像
主体()
{
初始化硬件();
(永远)
{
Read MMP6050();
写入文件();
}
}
记住:一个(纽约)项目变得复杂。而且,一个函数“RealMp6060-()”可以很容易地在你的下一个项目中重新使用。
快乐编码
鲍勃
以上来自于百度翻译
以下为原文
Welcome in the fascinating world of PSoCs!
At very first sight:
The I2C is interrupt-driven, so you MUST enable global interrupts.
It is always advisable to upload the complete project here, so that we all can have a look at. To do so, in Creator "File -> Create Workspace Bundle (minimal)" and then upload the resulting archive here.
For newbees usually C-language and programming turns out to be a problem, too. When the project grows it becomes more and more complex, so when you start early to divide it into smaller pieces it will help you. so your main() may look something like
main()
{
InitializeHardware();
while(forever)
{
ReadMPU6050();
WriteToLCD();
}
}
Remember: a(ny) project gets complicated. And: A function "ReadMPU6050()" can easily be re-used in your next project.
Happy coding
Bob
欢迎来到PSOCS的迷人世界!
乍一看:
I2C是中断驱动的,因此必须启用全局中断。
在这里上传完整的项目总是明智的,所以我们都可以看看。要做到这一点,在创建者“文件& GT;创建工作区束(最小)”,然后上传由此产生的档案。
对于新手来说,C语言和编程通常也是个问题。当项目增长时,它变得越来越复杂,所以当你早点开始把它分成更小的部分时,它会对你有所帮助。因此,您的主体()可能看起来像
主体()
{
初始化硬件();
(永远)
{
Read MMP6050();
写入文件();
}
}
记住:一个(纽约)项目变得复杂。而且,一个函数“RealMp6060-()”可以很容易地在你的下一个项目中重新使用。
快乐编码
鲍勃
以上来自于百度翻译
以下为原文
Welcome in the fascinating world of PSoCs!
At very first sight:
The I2C is interrupt-driven, so you MUST enable global interrupts.
It is always advisable to upload the complete project here, so that we all can have a look at. To do so, in Creator "File -> Create Workspace Bundle (minimal)" and then upload the resulting archive here.
For newbees usually C-language and programming turns out to be a problem, too. When the project grows it becomes more and more complex, so when you start early to divide it into smaller pieces it will help you. so your main() may look something like
main()
{
InitializeHardware();
while(forever)
{
ReadMPU6050();
WriteToLCD();
}
}
Remember: a(ny) project gets complicated. And: A function "ReadMPU6050()" can easily be re-used in your next project.
Happy coding
Bob
举报