Placing text on a FDS132

Hello,

For several days i try to place a text on a FDS132 board.

My initial program works. So simply placing text is working.

===========================================================================
/*
Thanks to Rudi Imbrechts (http://arduinows.blogspot.nl/) for the initial example.
*/
#include “fds132text.h”
#include <SPI.h>
fdsScreen mainScreen;
const int button_1=3;
const int button_2=4;
void setup() {
mainScreen.setPins(); // Uses the default from Rudi Imbrechts guide on how to set up the pins.

initialiseLetters() ;
mainScreen.addString(“First text”,0); // Add a string beginning at address 0 (the start of the screen)
mainScreen.addString(“Second text”,90); // This one will start at the start of line 2
mainScreen.addString(“Third text”,180); // And this halfway through the third line
mainScreen.update();
}
void loop (){
mainScreen.display();
}

This piece of code works perfect.

But, now i like to put three buttons on the arduino and by pressing button 1, text 1 will appear. The same for button 2 and 3.
I tried to code below but that does not work. I am not a regular programmer. Any idea what i am doing wrong?? It compiles but shows only the bottom row of the first text.

Thanks for your help.

/*
Thanks to Rudi Imbrechts (http://arduinows.blogspot.nl/) for the initial example.
*/
#include “fds132text.h”
#include <SPI.h>
fdsScreen mainScreen;
const int button_1=3;
const int button_2=4;
void setup() {
mainScreen.setPins(); // Uses the default from Rudi Imbrechts guide on how to set up the pins.

initialiseLetters() ;
//mainScreen.addString(“First text”,0); // Add a string beginning at address 0 (the start of the screen)
//mainScreen.addString(“Second text”,90); // This one will start at the start of line 2
//mainScreen.addString(“Third text”,180); // And this halfway through the third line
mainScreen.update();
}
void loop()
{
if (digitalRead (button_1))
{
mainScreen.addString(“I just,”,0);
mainScreen.addString(“pressed button”, 90);
mainScreen.addString(“one.”, 180);
mainScreen.update();
}
else
{
if (digitalRead (button_2))
{
mainScreen.addString(“I just”,0);
mainScreen.addString(“pressed”, 90);
mainScreen.addString(“button two.”, 180);
mainScreen.update();
}
mainScreen.display();
}
}

===========================================================================

Greetings, Emil

What pins does the FDS132, whatever that is, use?

Hi,

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom… :slight_smile: