Problems with Processing app

I am trying to create the DIY Etch A Sketch found here:
http://littlebits.cc/projects/diy-etch-a-sketch2

I have the littlebits connected like the picture, and I seem to have successfully uploaded the Arduino program. When I launch the processing file, I get a purple box but my dimmers don’t make anything happen. I know the dimmers work because I can take off the Arduino module and put on a bargraph and the lights light up appropriately as I turn the dimmer. Not sure what else to try…

Thanks!

Hi adama18,
It’s possible the Processing sketch is not selecting the correct serial port to communicate with the Arduino module.

On line 56 of the Processing sketch the line reads:

myPort = new Serial(this, Serial.list()[0], 9600);

Try incrementing the value in square brackets and then re-run the sketch to see if you receive functionality. For example, put the number 1 in the square brackets so it reads:

myPort = new Serial(this, Serial.list()[1], 9600);

Then click the “Play” button to start the sketch. If it still doesn’t work, try 2 and so forth.

Let me know if that helps.

So I read that in the comments on the project itself and by changing to 2 I was able to bring up the purple box, but not run the program. In response to this post, I’ve increase the number by 1 each time and I’m up to 9 and it’s still not working. Sometimes I get the purple box but no interaction from the dimmers and sometimes I get an error that the port could not be opened.

Is there someone else that I need to change a number?

Thanks!

que tal adama18,
al parecer tu problema se debe a que no estás asignando myPort al puerto que corresponde,
lo que puedes intentar es verificar en cuál puerto está asignado tu arduino
para eso mira en el IDE de Arduino, en la parte inferior derecha dice cuál es el puerto:

Arduino Leonardo on COM#
luego que ya tienes identificado a cuál puerto está asignado, (en mi caso es COM9)
ve al IDE de Processing en Setup() y lee detenidamente el código que dice:

initialize the Serial Port that will be recieving data from the littleBits Arduino Module
display all serial ports in text window

println(Serial.list());

use this to determine which serial port is your littleBits Arduino
count, starting with 0, the serial ports until you reach your littleBits Arduino
place that number in the command below
EXAMPLE: myPort = new Serial(this, Serial.list()[ your serial port number ], 9600);

al correr el Sketch en Processing se imprimirá el listado de puertos:

por ejemplo, mi puerto asignado a littleBits Arduino Module es COM9
entonces cuento comenzando desde 0 hasta encontrar el puerto COM9 en el listado
en mi caso:
COM3 representa 0
COM9 representa 1
entonces tomo el puerto del indice 1 porque es el indice asignado al puerto COM9
Serial.list()[1]

myPort = new Serial(this, Serial.list()[1], 9600);

espero que esto te ayude a solucionar tu problema y disculpa la convinacion de idiomas Inglés-Español pero probablemente si lo traducía no iba a representar realmente lo que quiero explicar.

saludos.

olvidé agregar otras consideraciones que deberás tomar en cuenta,

el Sketch de Processing correra sin problemas siempre y cuando encuentre un puerto válido para trabajar con el no importa si el modulo Arduino está conectado o no lo está,

realiza una prueba con los puerto que te muestra el listado en Processing pero no conectes el modulo arduino y notarás que el sketch muestra perfectamente el canvas de color littleBits purple, pero obviamente no funcionará, con ésto demuestras cuáles puertos están funcionando pero no son tu Arduino

otra cosa a considerar es:
mira en el IDE Arduino y verifica que hay un puerto asignado a tu modulo Arduino Leonardo como lo dice la Guía de Iniciación:

Now select the serial port the Arduino will communicate over by going back to “Tools” and selecting the correct port in the “Port” section. The name of the port will depend if you are on a Mac or Windows computer. On a Mac, it will start with /dev/tty.usbmodem… and a PC will start with COMM… In Windows…

suponemos que ésto lo tienes tomado en cuenta si cargaste el sketch en el modulo Arduino
pero no está de más si lo compruebas de nuevo,
te lo digo porque a veces la computadora asignará un puerto diferente cada vez que apagas, enciendes o desconectas el USB de Arduino y deberás hacer estos pasos de nuevo.

otra consideración es, verificar que la batería este proporcionando el voltaje necesario (9v) a tus modulos littleBits
Suerte.

Thank you for all of your help, Mario! I finally got it to work. I had been through all of these recommendations you gave but with your email I went through all over again. I did have to change the number for my serial port and even though I tried this before it finally worked this time. I wonder if also it helped that I had the dimmers turned all the way counter clockwise to be an a starting point? I’m not sure but it works now, I learned a lot and I’m happy! Thank you for taking the time to help me!

Anna

So glad to hear you were able to get the sketch working Anna! Thank your Mario for all your help and detailed walkthroughs.

you’re welcome
I’m happy to help

Hello I am having problems loading up my littlebits arduino.
Is it because I used a normal arduino with the same PC before?

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: “Arduino Leonardo”
C:\Users\Home\Downloads\arduino-1.0.6-windows\arduino-1.0.6\hardware\tools\avr\bin\avr-ar: unable to rename ‘core.a’; reason: File exists
core.a(main.cpp.o): In function main': C:\Users\Home\Downloads\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\cores\arduino/main.cpp:40: undefined reference tosetup’
C:\Users\Home\Downloads\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\cores\arduino/main.cpp:43: undefined reference to `loop’
I have ticked Leonardo and set the port as instructed

Hey @JaneWaite!

Sorry to hear about the issue with your Arduino Module. I have a couple questions/comments to suggest:

  1. Is this your first time connecting your Arduino Module to your computer? (Try using a separate COM Port)
  2. If possible, try using the Arduino on a separate computer to verify if it works or not.