Posts

BEST GPIO LIBRARY,, BEST I2C LIBRARY, BEST UART

BEST GPIO PWM I2C UART library (Linux) (no dependencies) SAMPLE CLOCK  ON OLED 96 DISPLAY // clock oled := Oled96(11, 0x3c, "OLED96"); oled.autoopen(false); function main(a) { if(oled.xopen("128x64",0,0)) { oled.clear_display(0); k = run(program, 1000); } oled.xclose(); return k; } function program(ctx,dev) { oled.write_string(0,1, get_strtime() ,2); return true; } GPIO CONTROL int i; b := PIO(506, DIR_IN, PULL_HIGH, "button"); l := PIO(507, DIR_OUT, LOW, "led"); function main(ctx) { b.set_monitor(true); return run(loop,-1); } function loop(ctx, dev) { if(dev){ if(0 == dev.get_value(/*this is the monitored button*/)) l.toggle(); } return true; }   PWM CONTROL int i; var pwm = PWM("0.0", 1000, 100, false, "pwm"); var k = 0; function main(ctx) { return run(loop,10); } function loop(ctx, dev) { pwm.set_val...