Code: Select all
MODULE Blinker;
(*
Example Cortex-M3 Oberon Program for NXP LPC17xx
Led connected to P2.10 blinking approx. once per second
*)
IMPORT Main, MCU, SYSTEM, Timer;
PROCEDURE Run();
CONST
(* led connected to pin P2.10 *)
ledBit = {10};
VAR
direction: SET;
BEGIN
(* Set led pin as output by setting the direction bit *)
SYSTEM.GET(MCU.FIO2DIR, direction);
SYSTEM.PUT(MCU.FIO2DIR, direction + ledBit);
WHILE TRUE DO
SYSTEM.PUT(MCU.FIO2CLR, ledBit);
Timer.MSecDelay(500);
SYSTEM.PUT(MCU.FIO2SET, ledBit);
Timer.MSecDelay(500)
END
END Run;
BEGIN
Run()
END Blinker.
Just change the definition of ledBit and all the FIO2... references to FIO0... e.g.
Code: Select all
ledBit = {22};
...
SYSTEM.PUT(MCU.FIO0DIR, direction + ledBit);
...