Hi,

This is my first step on the I2C road.
I have a Gravitech shield for the Arduino, that work well.
The code is very simple, and I have translate it to Forth.
The display is not working.
I include the Forth code. What is wrong?
Thangs for any help.

Cheers,

Jan

\ Gravitech display, I2C Generic

marker --gravitech--

$38 constant 7SEG  \ I2C address for 7-Segment

/ Configure 7-Segment to 12mA segment output current, Dynamic mode,
/ and Digits 1, 2, 3 AND 4 are NOT blanked

: init7SEG
  7SEG i2c.begin
    0 7SEG i2c.c!
    %01000111 7SEG i2c.c!
  i2c.end
;

: Send7SEG  ( Digit Number )
  7SEG i2c.begin
    swap 7SEG i2c.c! \ Digit
    7SEG i2c.c!      \ Number
  i2c.end
;


/* Configure 7-Segment to 12mA segment output current, Dynamic mode,
     and Digits 1, 2, 3 AND 4 are NOT blanked */

  Wire.beginTransmission(_7SEG);
  Wire.write(0);
  Wire.write(B01000111);
  Wire.endTransmission();


/***************************************************************************
 Function Name: Send7SEG

 Purpose:
   Send I2C commands to drive 7-segment display.
****************************************************************************/

void Send7SEG (byte Digit, byte Number)
{
  Wire.beginTransmission(_7SEG);
  Wire.write(Digit);
  Wire.write(Number);
  Wire.endTransmission();
}


_______________________________________________
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