LoginSignup
0
0

More than 5 years have passed since last update.

俺言語 その19

Last updated at Posted at 2018-03-10

概要

俺言語をやってみた。
avrにアセンブラで実装してみた。
ADCやってみた。

環境

avr studio 4
attiny85 1mhz
tera term
usb-serial

写真

MVC-005F.JPG

拡張

変数xの導入。
?=xで、ADCを表示。

get11:
    cpi     ADR, 'x' ;pb2
    brne    get12
    ldi     r16, 1 << ADLAR | 0 << MUX1 | 1 << MUX0
    out     ADMUX, r16
    ldi     r16, 1 << ADEN | 1 << ADSC | 1 << ADPS2 | 1 << ADPS1 | 1 << ADPS0
    out     ADCSRA, r16
adc1:
    sbic    ADCSRA, ADSC
    rjmp    adc1
    in      VAL, ADCH
    ret

サンプルコード

ヴォリュームで明るさ変わる。

10 e=x
20 f=x
30 g=x
40 #=10

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0