Oh, this should obviously not work too well... You should be calling this from setup(), not loop(). You're opening SPI over and over (which would start failing after exactly 1 attempt), as well as setting the button listener over and over. You should have tons of error messages in your log, which you've probably missed.
On Friday, February 14, 2014, Aaron Lim <[email protected]> wrote: > sorry i wasnt doing the way how it was supposed to be just now, i do it > again tying miso pin and mosi pin together still sending the response of 0 > > the voltage regulator at pin 18 are to stabilize IOIO on breadboard as i > have run out of spaces > > i had slightly modified the code, maybe there is error in the code : > > public void loop() throws ConnectionLostException { > spi = ioio_.openSpiMaster(12, 13, 14, 10, SpiMaster.Rate.RATE_1M); > byte0[0] = (byte) 24; > button1_.setOnClickListener(new OnClickListener() { > public void onClick(View view) { > try { > spi.writeRead(byte0, byte0.length, 1, byte1, byte1.length); > } catch (ConnectionLostException e) { > e.printStackTrace(); > } catch (InterruptedException e) { > e.printStackTrace(); > } > Toast.makeText(getApplicationContext(),String.valueOf(byte1[0]), > Toast.LENGTH_LONG).show(); > } > }); > > -- > You received this message because you are subscribed to the Google Groups > "ioio-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to > [email protected]<javascript:_e(%7B%7D,'cvml','ioio-users%[email protected]');> > . > To post to this group, send email to > [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> > . > Visit this group at http://groups.google.com/group/ioio-users. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "ioio-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/ioio-users. For more options, visit https://groups.google.com/groups/opt_out.
