unknowndomain
Member since Oct 2015 • Last active Jul 2016Most recent activity
-
Okay, it's been a while, I have been busy forgotten, come back to this now...
I found my other board, it works fine with one of the cables. I've managed to update the bootloader on there, and the other board is now being recognised but it will not flash, and I can't type into the REPL/Console...
In the console when plugged in this text appears...
Connected
Loading 11098 bytes from flash...
ho(0); 14:35:23","GIT_COMMIT":"0671a2d91de45a0e05c4b2b385264cf2ef16e463","BOARD":"ESPRUINOBOARD","CHIP":"STM32F103RCT6","CHIP_FAMILY":"STM32F1","FLASH":262144,"RAM":49152,"SERIAL":"34ffdd05-42573838-33692143","CONSOLE":"USB","EXPORTS":{"jsvLock":175045,"jsvLockAgainSafe":175033,"jsvUnLock":175009,"jsvSkipName":81269,"j:21701,"jsvMathsOpSkipNames":23465,"jsvNewFromFloat":77665,"jsvNewFromInteger":77701,"jsvNewFromString":176305,"jsvNewFromBool":77685,"jsvGetFloat":81509,"jsvGetInteger":80673,"jsvGetBool":81773,"jspeiFindInScopes":50889,"jspReplaceWith":19589,"jspeFunctionCall":54541,"jspGetNamedVariable":50941,"jspGetNamedField":52089,"jspGetVarNamedField":51761,"jsvNewWithFlags":175189}}=undefined
And I cannot type, and even when I now can get it into what I presume is DFU mode with the pulsing blue light, it will not update on this one board.
-
-
-
-
I've just updated my perfectly working board to this because the IDE advised it, and then used save() to flash the code I wrote to the board, and now the board is no longer showing up in the USB list on the IDE and when I use various cables to get into bootloader mode I get a blue solid and red light which occasionally pulses blue then goes red and blue solid and bright...
I really don't know what is wrong or what to do, there is no record of this issue happening before, but I am really up s*** creek right now.
-
I was using this but it doesn't work for some reason... it says:
Uncaught Error: Field or method "set" does not already exist, and can't create it on undefined at line 3 col 12...
Specifically this doesn't exist inside that DMX.prototype.newData function, or indeed inside any other than the first one DMX()...
I also don't know what you mean about bind, but I tried adding this and it also didn't work.
-
I've been working on creating a module for DMX... Not done this before, how does this stack up?
var exports = {}; function DMX( serial, interrupt ) { this.data = new Uint8Array( 512 ); this.id = 0; this.serial = serial; this.interrupt = interrupt; // Setup serial port this.serial.setup( 250000 ); this.serial.on( 'data', this.newData ); // Listeners this.dataListeners = []; this.channelListeners = {}; // Listen for the interrupt pin to drop setWatch( this.newFrame, this.interrupt, { repeat: true, edge: 'falling' } ); } // Handle new bytes of data as they come in DMX.prototype.newData = function( d ) { // Store the bytes received at the buffer index DMX.data.set( d, DMX.id ); // Move the buffer index along. DMX.id += d.length; }; // Send out notifications to all event listeners when frame is complete. DMX.prototype.newFrame = function() { // Reset the byte buffer index to 0 for the next frame of data. DMX.id = 0; // Itterate through all the registered data listeners and send them the data for ( var i in DMX.dataListeners ) DMX.dataListeners[i]( DMX.data ); // Itterate through all the registered channel listeners and send them their channel values for ( var ch in DMX.channelListeners ) for ( var j in DMX.channelListeners[ch] ) DMX.channelListeners[ch][j]( DMX.data[ ch ] ); }; // Handle registration to event notifications DMX.prototype.on = function( type, handler ) { // If data listener: push function onto array if ( type == 'data' ) DMX.dataListeners.push( handler ); // If channel listener if ( type >= 1 && type <= 512 ) { // Check channel for existing listeners if ( DMX.channelListeners[type] !== undefined ) { // Push additional listener onto array DMX.channelListeners[type].push( handler ); } else { // Otherwise: create new array with listener in it DMX.channelListeners[type] = [ handler ]; } } }; // Export the module exports.connect = function( serial, interrupt ) { return new DMX( serial, interrupt ); }; /////////////// var DMX = exports.connect( Serial2, B9 ); // Listen for changes on channel 1 DMX.on( 1, function( val ) { analogWrite( LED1, val / 255, { forceSoft: true } ); } ); // Listen for changes on channel 2 DMX.on( 2, function( val ) { analogWrite( LED2, val / 255, { forceSoft: true } ); } ); // Listen for changes on channel 3 DMX.on( 3, function( val ) { analogWrite( LED3, val / 255, { forceSoft: true } ); } ); // Listen for full frames of data DMX.on( 'data', function( data ) { // console.log( data ); } );
-
I am not sure if you are aware but Persona is being shut down on the 30th November:
https://developer.mozilla.org/en-US/Persona