Gents,
This started me thinking about looking at the code that was being produced, rather than the mblock! Turns out the problem was pretty annoyingly simple, …my mblock code generates the following;
float counter = 0;
float latchPin = 0;
float clockPin = 0;
float dataPin = 0;
float divi = 0;
float outputbit = 0;
float tval = 0;
float result = 0;
float wait = 0;
float digit = 0;
float value = 0;
void _delay(float seconds) {
long endTime = millis() + seconds * 1000;
while(millis() < endTime) _loop();
}
void setup() {
pinMode(latchPin,OUTPUT);
pinMode(dataPin,OUTPUT);
pinMode(12,OUTPUT);
pinMode(6,OUTPUT);
pinMode(13,OUTPUT);
pinMode(clockPin,OUTPUT);
wait = 0.001;
dataPin = 8;
clockPin = 10;
latchPin = 9;
Note the assignment of variables comes AFTER the pin setup! If I move the assignments BEFORE the pin setup - voila!!!.. this could be a problem with the code generation unless Im missing something really obvious…anyway I’m back on track, and my 7 yo is talking to me again Cheers for the help and encouragement…
float counter = 0;
float latchPin = 0;
float clockPin = 0;
float dataPin = 0;
float divi = 0;
float outputbit = 0;
float tval = 0;
float result = 0;
float wait = 0;
float digit = 0;
float value = 0;
void _delay(float seconds) {
long endTime = millis() + seconds * 1000;
while(millis() < endTime) _loop();
}
void setup() {
dataPin = 8;
clockPin = 10;
latchPin = 9;
pinMode(latchPin,OUTPUT);
pinMode(dataPin,OUTPUT);
pinMode(12,OUTPUT);
pinMode(6,OUTPUT);
pinMode(13,OUTPUT);
pinMode(clockPin,OUTPUT);
wait = 0.001;