Most recent activity
-
-
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. -
-
-
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.