-
-
Hello,
I've come back to experimenting with this excellent tool and I've noticed there's a Waveform class.
I've been trying to use it on a VET6 running v1.48 (I can't get newer versions to work - just get a white screen when I flash it).var w = new Waveform(256); for (var i=0;i<1024;i++) w.buffer[i] = 128+Math.sin(i*Math.PI/128)*127; analogWrite(A4, 0.5); w.startOutput(A4, 4000);
After the first line I get the error "ERROR: Constructor should be a function..."
I am not sure how to use Classes, or if it is automatic. Is this Class not included in v1.48 - or the VET6?
Many thanks,
Harry
-
Hi Gordon,
Sorry, I'm not too familiar with the nightly build concept - I downloaded on the 30th Jan if that helps.An example of the delays I built in were as follows:
function toggle3() { LCD.clear(); digitalPulse(A2,1,50); digitalPulse(A2,0,50); LCD.setColor(0, 0, 0); digitalPulse(A2,1,50); digitalPulse(A2,0,50); LCD.fillRect(1, 1, 320, 240); digitalPulse(A2,1,50); digitalPulse(A2,0,50); LCD.setColor(0, 1, 0); digitalPulse(A2,1,50); digitalPulse(A2,0,50); PotPos = analogRead(C0); digitalPulse(A2,1,50); digitalPulse(A2,0,50); LCD.drawString(PotPos, 230, 210); digitalPulse(A2,1,50); digitalPulse(A2,0,50); setInterval(function() { LCD.clear(); digitalPulse(A2,1,20); digitalPulse(A2,0,20); PotPos = analogRead(C0); digitalPulse(A2,1,20); digitalPulse(A2,0,20); LCD.drawString(PotPos, 200, 210); }, 200); digitalWrite(LED2,p=!p); } var l = false; var p = false; var PotPos = 0.1; setInterval("digitalWrite(LED1,l=!l);",800); setWatch(toggle3, E5, {repeat: true, edge:'falling'});
Whether or not this program worked was dependent on the digitalPulse duration, and was often not repeatable. I found mathematical operations were less fussy than instructions involving the LCD.
Introducing a SetInterval made things more complicated, and sometimes seemed to want a couple of digitalPulses at the end of the loop, and sometimes didn't. I'd have to evaluate one step at a time and see if it crashed.
-
I downloaded the latest version on the website a week ago - that was the version I was using.
I found if I put delays (digital pulse) in between all my instructions, I could get the LCD to operate on save(); - however it was temperamental and results were not always repeatable. I programmed in a constantly flashing light so I could tell if it had hung or not, which would happen quite often. However, sometimes the light would flash but the LCD would just be white. Adding a delay or changing the delay time sometimes fixed this. -
-
-
-
-
Hello,
I have a STM32 2.4 inch LCD Board (VET6). The LCD works fine in the Web IDE, but when I type save() and it loads to flash, the screen comes back white and does not respond to commands. The rest of the program appears to be operating (in the example below the lights keep flashing):
function toggle1() {
on1 = !on1;
digitalWrite(LED4, on1);
LCD.drawString("Hello World!", 1, 20);
}
function toggle2() {
on2 = !on2;
digitalWrite(LED3, on2);
LCD.clear();
}var l = false;
setInterval("digitalWrite(LED1,l=!l);",200);setWatch(toggle1, E4, {repeat: true, edge:'falling'});
setWatch(toggle2, E3, {repeat: true, edge:'falling'});The LCD displays the Espruino start screen fine when not connected to the computer (mobile phone power supply) and it has just been flashed in "Flash Loader Demo". Do I have to initialise the screen, am I missing something obvious?
Many thanks,
Harry
-
-
-
-
Hello,
Espruino looks like a great tool; however, I am having some difficulties.
I am using an HYSTM32_24.
I am using Espruino Web IDE. Connection to the board is fine, and it does operate some code.
Occasionally codes will not run and the board will not respond, requiring a reset.Please could you explain why this code would work:
LCD.clear(); LCD.setColor(0, 0, 0.0); LCD.fillRect(0, 0, 320, 240); LCD.setFontBitmap(); LCD.setColor(0, 1, 0); setTimeout(function() { LCD.drawString("> Line 1", 1, 10); LCD.drawString("> Line 2", 1, 30); }, 50);
but this code would cause it to pause?
LCD.clear(); LCD.setColor(0, 0, 0.0); LCD.fillRect(0, 0, 320, 240); LCD.setFontBitmap(); LCD.setColor(0, 1, 0); setTimeout(function() { LCD.drawString("> Line 1", 1, 10); LCD.drawString("> Line 2", 1, 30); LCD.drawString("> Line 3", 1, 50); }, 50);
I am struggling to get three lines written one after the other!
Many thanks,
Harry
Yes - I think I will get one of the Espruino boards for the real experimenting. Just trying to find a use for these other ones I have first!
Thanks for your help.