IchigoLatte

IchigoLatte is a Kids OS which is a little adult.
You can program with JavaScript.
It will be available by installing the IchigoJam machine.


*

IchigoLatteはちょっぴり大人なこどもOS
JavaScriptでプログラミングできます。
IchigoJam機にインストールしてご利用ください。

Ver 0.9.1
2016/06/29

movie

reference

(IchigoLatte) - A Kids OS. * ScrLock You can change NTSC mode when your TV monitor can't display well. (lash) - A latte shell. * . A editable file io. * uart UART serial io. * @(no) EEPROM file io. no: 0~63 (when 1Mbit) * ex. >cat . > uart >cat uart > . >cat @0 > . >cat . > @63 + 'ms .' will be ran by pushing the button at the system booting. + it will switchs mode console<->uart mutually when btn is pushed or ctrl+d is received. (can't use 'vi' in uart mode.) (echo) - A argument printer. * ex. >echo Hello World. (cat) - A input printer. * 'ESC' exit. * ex. >cat . >cat uart (ls) - A eeprom viewer. * ex. >ls (vi) - A text editor. * 'ESC' save and exit. * Ctrl+D exit.(NOT saved.) (ms) - A simple JavaScript engine. * ex. Interactive mode >ms * ex. Execution mode >ms . - [global object 'latte' members] * log(v, ...) print v to screen. * led(v) v==0 : led off v==1 : led on * btn() return 0/1 status about onborard button. * in(v) return 0/1 status about in-port no. v. * out(v) change out-port status. bit field of v is each port no. * cls() clear screen. * lc(x, y) locate cursor to x and y. * sleep(v) sleep in v(msec). * inkey() return keyboard code that last pressed. * rnd(v) return random number less than v. * chr(v) return char as string of v. * sin8(v) return sin value by integer(x256). v is degree(s).(NOT radian) * tick() return msec that from system booted. * ana(p) return analog value of the port. p==0 : btn p==2 : in2 p==5-8 : out1-4 * scr(x, y) return char value of the screen at x and y. * pwm(p, d) output pwm signal on port p with duration d. * pwmt(t) set pwm cycle to t. * scroll(v, [r]) scroll screen to v. v==0 : up v==1 : right v==2 : down v==3 : left r is rotation mode. r==0 : no rotate[DEFAULT] r==1 : rotate * video(v) switch ntsc signal. v==0 : off v==1 : on v==2 : on(invert mode) * setTout(f, d) set a function f to be invoked at d(msec) later. ex. | function onTime(){...} | setTout(onTime, 1000); * setTout() unset function about Tout. * setKprs(f) set a function f to be invoked at key pressed. ex. | function onKey(k){...} | setKprs(onKey); * setKprs() unset function about Kprs. * input() return a number that user inputted. * uart(v, ...) write v to uart. if v is number a byte binary will be sent to uart. * uart() if call with no args this will return a number that uart received. * i2cw(a, ...) write to i2c device that is addressed a. params "..." will be sent to device. * i2cr(a, ...) read from i2c device that is addressed a. the values will be set to params "..." when function returned. * exit(v) exit code. - [Array members] + You can create only one of the Array at the same time. * Array(v) create new array of v length. ex. | var a = new Array(10); * Array() create new array of max length. ex. | var a = new Array(); * length a length of the array.

IchigoLatte 0.9.1 ECMAScript

[Implemented]

* var * function, return * if-else * while, break * number literal * string("") literal * =, +, -, *, /, ==, !=, <, >, %, <=, >=, ! * , ; * { } * new, this * // * +, - as immediate value * multiple var * try-catch, throw * >>,<<,&,|,^



[global object: latte]

* You must **omit** the "latte.". * 'latte' members * log(v, ...) * led(v) * btn() * in(v) * out(v) * cls() * lc(x, y) * sleep(v) * inkey() * rnd(v) * chr(v) * sin8(v) * tick() * ana(p) * scr(x, y) * pwm(p, d) * pwmt(t) * scroll(v) * video(v) * setTout(f, d) * setKprs(f) * input() * uart() * i2cw(a, ...) * i2cr(a, ...) * exit(v) * 'Array' members * length



[NOTES]

* The object that created by new can have 4 members.
* Assigning a function to a var is available.
* It will be reset after LED blinking when serious error occuered.
* Type of number is integer 32bit now.
* Method Chain is available.
* There is a mechanism setTout like the setTimeout.
* There is try-catch, throw.
* There is Array.
* Anonymous function available.
* It can be hardware control using the GPIO,UART,I2C.


* new された object が持てるメンバは最大4つ。
* 変数に関数の代入可能。
* 深刻な構文エラー、実行時エラーなどはLED点滅後ハードリセットします。
* 今のところNumber型は32bit整数。
* メソッドチェーン動きます。
* setTimeout的な仕組み setTout あります。
* try-catch, throw あります。
* 配列あります。
* 無名関数が動きます。
* GPIO,UART,I2C を用いたハード制御が可能です。