Code:
#include "WProgram.h"
#include "bitlash.h"
// Declare a user function named "timer1" returning a numeric Bitlash value
//
//Pin connected to ST_CP of 74HC595
int latchPin = 44;
//Pin connected to SH_CP of 74HC595
int clockPin = 46;
////Pin connected to DS of 74HC595
int dataPin = 48;
numvar timer1(void) {
return TCNT1; // return the value of Timer 1
}
void blinkie(numvar val) {
//ground latchPin and hold low for as long as you are transmitting
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, val);
//return the latch pin high to signal chip that it
//no longer needs to listen for information
digitalWrite(latchPin, HIGH);
}
void setup(void) {
initBitlash(57600); // must be first to initialize serial port
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
// Register the extension function with Bitlash
// "timer1" is the Bitlash name for the function
// 0 is the argument signature: takes 0 arguments
// (bitlash_function) timer1 tells Bitlash where our handler lives
//
addBitlashFunction("timer1", 0, (bitlash_function) timer1);
addBitlashFunction("blinkie", -1, (bitlash_function) blinkie);
}
void loop(void) {
runBitlash();
}
#include "bitlash.h"
// Declare a user function named "timer1" returning a numeric Bitlash value
//
//Pin connected to ST_CP of 74HC595
int latchPin = 44;
//Pin connected to SH_CP of 74HC595
int clockPin = 46;
////Pin connected to DS of 74HC595
int dataPin = 48;
numvar timer1(void) {
return TCNT1; // return the value of Timer 1
}
void blinkie(numvar val) {
//ground latchPin and hold low for as long as you are transmitting
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, val);
//return the latch pin high to signal chip that it
//no longer needs to listen for information
digitalWrite(latchPin, HIGH);
}
void setup(void) {
initBitlash(57600); // must be first to initialize serial port
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
// Register the extension function with Bitlash
// "timer1" is the Bitlash name for the function
// 0 is the argument signature: takes 0 arguments
// (bitlash_function) timer1 tells Bitlash where our handler lives
//
addBitlashFunction("timer1", 0, (bitlash_function) timer1);
addBitlashFunction("blinkie", -1, (bitlash_function) blinkie);
}
void loop(void) {
runBitlash();
}
its still not taking my hex values and displaying what i want bit its a start.
