Author Topic: Connect Thermal Print from SPARKFUN to Wiring  (Read 265 times)

0 Members and 1 Guest are viewing this topic.

AnaMaria

Connect Thermal Print from SPARKFUN to Wiring
« on: November 07, 2016, 05:13:03 PM »
In advance, thank you very much for your help,
I write because I have a doubt with a wiring code, i want to know if you can helpme to solve it. I'm trying to connect the thermal printer from Sparkfun to wiring and then, use it with Wiring S.The code have this error:

error: 0:
/Applications/Wiring.app/Contents/Java/cores/AVR8Bit/libraries/SoftwareSerial/SoftwareSerial.h:30:18: error: conflicting return type specified for 'virtual void SoftwareSerial::write(uint8_t)'
In file included from /Applications/Wiring.app/Contents/Java/cores/AVR8Bit/libraries/SoftwareSerial/SoftwareSerial.h:23:0,
prueba1:-1: error: /Applications/Wiring.app/Contents/Java/cores/Common/Print.h:47:20: error:   overriding 'virtual size_t Print::write(uint8_t)'


Here is the code ..


#include <SoftwareSerial.h>
SoftwareSerial Thermal(2, 3);
int heatTime = 80;
int heatInterval = 255;
char printDensity = 15;
char printBreakTime = 15;
void setup()
{
 Serial.begin(57600); // for debug info to serial monitor
 Thermal.begin(19200); // to write to our new printer
 initPrinter();
}
void initPrinter()
{
 //Modify the print speed and heat
 Thermal.write(27);
 Thermal.write(55);
 Thermal.write(7); //Default 64 dots = 8*('7'+1)
 Thermal.write(heatTime); //Default 80 or 800us
 Thermal.write(heatInterval); //Default 2 or 20us
 //Modify the print density and timeout
 Thermal.write(18);
 Thermal.write(35);
 int printSetting = (printDensity<<4) | printBreakTime;
 Thermal.write(printSetting); //Combination of printDensity and printBreakTime
 Serial.println();
 Serial.println("Printer ready");
}
void loop()
{
 Thermal.println(" Visit http://tronixstuff.com ");
 Thermal.write(10); //Sends the LF to the printer, advances the paper
 Thermal.print(" Millis = ");
 Thermal.println(millis());
 Thermal.write(10);
 Thermal.write(10);
 do { } while (1>0);
}