These are chat archives for Makeblock-official/mbot_nodebots

18th
Aug 2015
Anna Gerber
@AnnaGerber
Aug 18 2015 06:43
For anyone else looking for it, the schematic for the mCore board is here: https://github.com/Makeblock-official/mBot/blob/master/pcb/mCore.pdf
Anna Gerber
@AnnaGerber
Aug 18 2015 09:30
Working my way through the sample code, most of it works fine, except for button
I had to change pin 22 to "A7" to avoid getting this error:
... firmata/lib/firmata.js:700
this.pins[pin].mode = mode;
^
TypeError: Cannot set property 'mode' of undefined
at Board.pinMode (/Users/anna/Development/git/mbot_nodebots/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:700:23)
at new Sensor (/Users/anna/Development/git/mbot_nodebots/node_modules/johnny-five/lib/sensor.js:79:11)
It would be nicer to use the Button class rather than Sensor but I guess we'd need a custom controller that converts the raw values from the button (0 and 1023) to 0 and 1
Anna Gerber
@AnnaGerber
Aug 18 2015 09:54
Things that have tripped me up so far:
  1. didn't have the switch on the side turned on when trying to flash the board and couldn't work out why it would show up in Arduino IDE at first. Lights near the battery connector come on when it is plugged into USB even when this switch is off, so it looks like it is on
  2. sensor cables shown in the instruction booklet are reverse to code samples (instructions show proximity sensor cable goes to port 3 in instructions, reflectance sensor to port 2 but the code examples expect prox=2, reflect=3)
Anna Gerber
@AnnaGerber
Aug 18 2015 10:00
(typo above: I changed pin 21 to "A7" in button.js)
ajfisher
@ajfisher
Aug 18 2015 23:07
@AnnaGerber Ahh so that error is possibly because your boards file didn't have pin A6 and A7 included. I ran into a bug with this though and couldn't track it down
And yep - I noticed that with the book too... When I built my one and the code for this I didn't have a book towork from so just jammed stuff together ;P