收到的板子也是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
- }
收集了一些资料,估计大家也都能找到
[
本帖最后由 nwcheroes 于 2013-10-25 22:08 编辑 ]