收到的板子也是Stellaris LM4F120 Launchpad,发现最新的Energia正好支持这块板子,弄了个小程序,三色LED轮流闪。
感觉用Arduino这样的开发环境方便很多啊,简单,占用空间少
- // the setup routine runs once when you press reset:
- void setup() {
- // initialize the digital pin as an output.
- pinMode(RED_LED, OUTPUT);
- pinMode(BLUE_LED, OUTPUT);
- pinMode(GREEN_LED, OUTPUT);
- }
- // the loop routine runs over and over again forever:
- void loop() {
- digitalWrite(RED_LED, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(RED_LED, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
-
- digitalWrite(BLUE_LED, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(BLUE_LED, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
-
- digitalWrite(GREEN_LED, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(GREEN_LED, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
- }
复制代码收集了一些资料,估计大家也都能找到
Stellaris LaunchPad入门讲座.rar
(6.64 MB, 下载次数: 75)
[
本帖最后由 nwcheroes 于 2013-10-25 22:08 编辑 ]