To light LED1, we need the electric current flow from VCC
to P10
.
#include "stc8fsdcc.h"
#include "delay.h"
void main(void) {
P55 = 0; // allows electric current flow from VCC
while (1) {
P10 = 0; // output 0v, led on
delay_ms(1000);
P10 = 1; // output 5v, led off
delay_ms(1000);
}
}
sdcc --Werror --model-small blink.c -o blink.hex
packihx blink.hex > upload.hex
stcgal -P stc8 upload.hex