Unable to display count on LCD display
in Propeller 1
I am trying to display a count on a LCD display. I have worked with Basic Stamp II since they came out, but this is my 1st time for the Propeller chip using SimpleIDE
The following is a copy of my code.
#include "simpletools.h" // Include simpletools
const int ON = 254;
const int CLR = 1;
int main() // main function
{
serial *lcd = serial_open(12, 12, 0, 9600); //Pin12
writeChar(lcd, ON);
writeChar(lcd, CLR);
pause(5);
int cycles = count(16,1000); // Count for 1 second Pin16
pause(10);
dprint(lcd,"count=", cycles);
pause(10);
}
Your assistance will be appreciated.
Dave
The following is a copy of my code.
#include "simpletools.h" // Include simpletools
const int ON = 254;
const int CLR = 1;
int main() // main function
{
serial *lcd = serial_open(12, 12, 0, 9600); //Pin12
writeChar(lcd, ON);
writeChar(lcd, CLR);
pause(5);
int cycles = count(16,1000); // Count for 1 second Pin16
pause(10);
dprint(lcd,"count=", cycles);
pause(10);
}
Your assistance will be appreciated.
Dave
Comments
#include "simpletools.h" #define ON 22 #define OFF 21 #define CLR 12 #define LEFT 8 #define RIGHT 9 serial *s; int i; int main() { s = serial_open(0, 0, 0, 19200); writeChar(s, ON); writeChar(s, CLR); dprint(s, "Hello"); while(1) { pause(500); } }
Mike
while (1) { i = count(16, 1000); dprint(lcd, "count=%d", i); pause(1000); }
Mike
Mike
Thank you that worked
Dave
#define PIN 16 int main() { int Mask = 1 << PIN; waitpeq(0, Mask); //wait for low state printi("Pin Low\n"); waitpne(0, Mask); //wait for high state printi("Pin High\n"); }