STM32F4 DISCOVERY and Version 1v51 Data is sent and received but ZERO is got from the Javascript side.
function onInit() { SPI1.setup({ mode:0, sck: A5, miso: A6, mosi: A7, cs: E3 } ); SPI1.send([0x20,0b01000111], E3); getAcc(); } var avrx=0.0, avry=0.0; function getAcc(){ var accx = SPI1.send([0xA9,0], E3)[1]; var accy = SPI1.send([0xAB,0], E3)[1]; if (accx>127) accx-=256; if (accy>127) accy-=256; avrx = 0.1*accx + 0.9*avrx; avry = 0.1*accy + 0.9*avry; console.log("X= "+accx+" Y= "+accy); } onInit();
1 Attachment
@user6350 started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
STM32F4 DISCOVERY and Version 1v51
Data is sent and received but ZERO is got from the Javascript side.
1 Attachment