[原创] TIVA C Launchpad周计划——第一周(点亮LED)

nwcheroes   2013-10-25 22:07 楼主
收到的板子也是Stellaris LM4F120 Launchpad,发现最新的Energia正好支持这块板子,弄了个小程序,三色LED轮流闪。
感觉用Arduino这样的开发环境方便很多啊,简单,占用空间少
QQ截图20131025215323.jpg

IMAG0146.jpg
IMAG0148.jpg
IMAG0149.jpg
  1. // the setup routine runs once when you press reset:
  2. void setup() {               
  3.   // initialize the digital pin as an output.
  4.   pinMode(RED_LED, OUTPUT);     
  5.   pinMode(BLUE_LED, OUTPUT);
  6.   pinMode(GREEN_LED, OUTPUT);
  7. }

  8. // the loop routine runs over and over again forever:
  9. void loop() {
  10.   digitalWrite(RED_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  11.   delay(1000);               // wait for a second
  12.   digitalWrite(RED_LED, LOW);    // turn the LED off by making the voltage LOW
  13.   delay(1000);               // wait for a second
  14.   
  15.   digitalWrite(BLUE_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  16.   delay(1000);               // wait for a second
  17.   digitalWrite(BLUE_LED, LOW);    // turn the LED off by making the voltage LOW
  18.   delay(1000);               // wait for a second
  19.   
  20.   digitalWrite(GREEN_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  21.   delay(1000);               // wait for a second
  22.   digitalWrite(GREEN_LED, LOW);    // turn the LED off by making the voltage LOW
  23.   delay(1000);               // wait for a second
  24. }
收集了一些资料,估计大家也都能找到
Stellaris LaunchPad入门讲座.rar (6.64 MB)
(下载次数: 75, 2013-10-25 22:08 上传)


[ 本帖最后由 nwcheroes 于 2013-10-25 22:08 编辑 ]

回复评论

暂无评论,赶紧抢沙发吧
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复