Strict Standards: Declaration of Doku_Renderer_metadata::table_open() should be compatible with Doku_Renderer::table_open($maxcols = NULL, $numrows = NULL, $pos = NULL) in D:\www\www865\dokuwiki\inc\parser\metadata.php on line 24 Strict Standards: Declaration of Doku_Renderer_metadata::table_close() should be compatible with Doku_Renderer::table_close($pos = NULL) in D:\www\www865\dokuwiki\inc\parser\metadata.php on line 24

eLua auf der mbed Plattform

Der Kern dieses mbed Mikrocontroller Boards ist ein NXP LPC1768, mit einem 32-bit ARM Cortex-M3, einem Clock von 96 MHz, 512 KB FLASH, 32 KB RAM und jede Menge Peripherie (Ethernet, USB Host & Device, CAN, SPI, I2C, ADC, DAC, PWM u.a.m.).

Mit den vorhandenen Ressourcen ist das eine hervorragende Prototyping-Plattform. Nähere Einzelheiten sind hier zu finden: mbed Beschreibung

Das mbed-Xpresso Baseboard stellt eine gute Prototyping-Plattform dar. Das Board ist kompatibel mit den LPCXpresso Boards von NXP und dem mbed Board.

Weitere Informationen und Bezugsmöglichkeit: Trioflex

Dieses einfache Programmbeispiel zeigt einen Test im Sinn von „Hello World“:

print("\nTest of eLua on mbed board")
print("==========================")

local uartid, invert, ledpin = 0
local flag = true

if pd.board() == "MBED" then
   ledpin = mbed.pio.LED1
   mbed.pio.configpin( ledpin, 0, 0, 0 )
   pio.pin.setdir( pio.OUTPUT, ledpin )
else
   print( "Error: No mbed board!" )
   return
end

function blink()
   if flag then
      pio.pin.sethigh( ledpin )
      tmr.delay(0, 50000) 		-- wait for 50 ms
   else
      pio.pin.setlow( ledpin )
      tmr.delay( 0, 950000 )		-- wait for 950 ms
   end
   flag = not flag
end

print("This is eLua V." .. elua.version() .. " on " .. pd.board() .. " board")
print("Watch your LED1 blinking...")

print("CPU on mbed board is " .. pd.cpu())
print("CPU clock is " .. cpu.clock()/1000000 .. " MHz")
print("Timer0 clock is " .. tmr.getclock(0) .. " Hz")

print("Press any key to end this test!")
while uart.getchar( uartid, 0 ) == "" do
   blink()
end

print("Program stopped.")

Weitere Programmbeispiele sind auf SourceForge zu finden.

 
elua_on_mbed.txt · Zuletzt geändert: 2012/03/04 00:43 von Claus Kühnel
 
Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki