hello,

The best wishes for 2019.

I’m try to get info from a TM1638 ( reading button status).
This is my simple routine, I read the lower byte first!
The code is simple and is straight forward
Is the code correct?

Does anyone have experience whit  this?


variable received_byte
: receiveByte ( --- byte )
  0 received_byte !
  8 0 do
    clockPin high
    dataPin pin_high?
    if
      received_byte @ 1 i << or received_byte !
    else
      received_byte @ 0 i << or received_byte !
    then
    clockPin low
  loop
  received_byte @  \ byte
;


May the Forth be with you in the new year 2019

Cheers

Jan


_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to