A short overview for beginners with microcontrollers and/or the programming language Luna.
After starting the program „LunaAVR“ adjust the setting for ide-programmer-uploader.
Other settings are at the moment not required, we are now ready to start programming.
A Luna program requires a minimum of three definitions:
Learn more: Root class Avr
Example for an empty correct program:
avr.device = atmega168 avr.clock = 8000000 avr.stack = 32 halt()
Another simple program, an LED connected to PortB.0 (Pin 14) is flashing:
Learn more: #Define, Port-pins of the microcontroller und Wait, Waitms, Waitus
avr.device = atmega168 avr.clock = 8000000 avr.stack = 32 #define LED1 as portB.0 'LED1 is defined as label for portB.0 LED1.mode = output,low 'the port is configured as output and set to low do LED1 = 1 'switch LED1 on waitms 500 'wait for 500ms LED1 = 0 'switch LED1 off waitms 500 'wait for 500ms 'alternatively for the commands above also following commands can be used 'LED1.toggle 'toggle the actual status of the port pin 'wait 1 'wait for 1 second loop