Snap4Arduino Mega, PWM and Analog 0 issues

306 views
Skip to first unread message

Bernat Romagosa

unread,
Jan 20, 2014, 5:12:11 AM1/20/14
to s4a-co...@googlegroups.com
Hi Gary and all,

I've decided to open a new thread, the other one was getting huge and was not about the original topic (the initial Snap4Arduino pre-alpha release) anymore.

I'm taking a look at the issues you reported. Here's what I found:

For Mega, any pin higher than 13 does not work.

Are you sure you're using the latest version? It does work for me... see the video I've just recorded:  

2)      PWM

There is a block to set up the PWM pin, but where is the block for controlling the PWM ??

Wow! How did I not notice this? I'm fixing it today! 

3)      Servo

Again, the higher pins (from Pin 14 and above) on the Mega does not work.

This should also be related to 1), it does work for me... please make sure you're using the latest version.

4)      Analog Input

Analog pins from A1 to A15 are okay, except for analog pin A0.

If the “analog reading(0)” block is used, it will disable the rest of the blocks.

Correct, thanks for reporting! I'll fix this today too.

I'll get back to you when I'm done fixing these.

Cheers!

Bernat.


--
Bernat Romagosa
Equip de recerca (Edutec)

FUNDACIÓ PEL FOMENT DE LA
SOCIETAT DEL CONEIXEMENT 
CORNELLÀ

Citilab Cornellà | http://citilab.eu | Pl. Can Suris s/n | 08940 Cornellà de Llobregat | Barcelona
35F.gif

Bernat Romagosa

unread,
Jan 20, 2014, 6:57:06 AM1/20/14
to s4a-co...@googlegroups.com
Hi all,

New version 0.39 pre-alpha is up at http://s4a.cat/snap/#download

Brief Changelog
===========
* Analog0 freeze bug fixed
* Added an Arduino block category
* Added a set PWM value block (automatically calculates a 256 module)

Please confirm Mega 2560 is working for you guys. I tried it in different machines, under Linux and WinXP, and it worked flawlessly with all pins up to digital 53...

Thanks a lot to Gary for his bug reports. Please keep them coming, the bug monster is hungry!!!

Cheers!
Bernat.




2014/1/20 Bernat Romagosa <brom...@e-citilab.eu>
35F.gif

Gary Chung

unread,
Jan 20, 2014, 11:50:35 AM1/20/14
to Bernat Romagosa, s4a-co...@googlegroups.com

Bernat,

The video shows that you were testing digital output. What I had earlier reported was meant for digital input.

Anyway, I’ve downloaded the latest version (Ver 0.39) and tested with the following result :

 

1)      Digital Input

I used digital input 14 connected to a button (with a 10K pull up resistor) and it does not seem to

capture the button status. The script is below :

 

 

                Replacing the pins from 2 ~ 13 as digital input works fine.

                Testing the pin 50 does not work as well.

                It’s the same issue I had with the earlier version.

                Digital input does not work from pins 14 and above.

2)      PWM

Works flawlessly on pins 2 ~ 9, but no response on pins 44~46.

 

3)      Servo

I don’t have the servos now, will test it out later on.

 

By the way, have you tested the servos and buttons on the higher pins ??

If it works for you, where did I go wrong ??? I’m using windows 8.1.

 

Regards

Gary

--
You received this message because you are subscribed to the Google Groups "S4A Community Mail List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s4a-communit...@googlegroups.com.
To post to this group, send email to s4a-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/s4a-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/s4a-community/CAALy94MBw6qrghzuoRv3GzzwprF80-Q2OZtcWS0GDwEJhSqHiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

image001.gif
image002.png

Bernat Romagosa

unread,
Jan 21, 2014, 9:13:17 AM1/21/14
to Gary Chung, s4a-co...@googlegroups.com

1)      Digital Input

I used digital input 14 connected to a button (with a 10K pull up resistor) and it does not seem to

capture the button status. The script is below :

Oh I see! For some reason I assumed you were talking about outputs, my bad! So I'm gonna try to fix these today, it shouldn't be too hard. 

2)      PWM

Works flawlessly on pins 2 ~ 9, but no response on pins 44~46.

Hmmm... on my Mega 2560 board, the pins marked as PWM are 2 to 13. The rest of the digital pins are marked as plain digital... Is your board showing more PWM-capable pins than mine?

Cheers!
Bernat.

Gary Chung

unread,
Jan 21, 2014, 9:45:06 AM1/21/14
to Bernat Romagosa, s4a-co...@googlegroups.com

Bernat,

The Mega 2560 supposed to have 15 PWM outputs, and I just check their site http://arduino.cc/en/Main/arduinoBoardMega2560

 

 

Below is an abstract.

 

I don’t think your Mega 2560 is different from mine, unless you got it from a Chinese clone, LOL !!

 

Regards

Gary

image001.png

Bernat Romagosa

unread,
Jan 21, 2014, 9:56:18 AM1/21/14
to Gary Chung, s4a-co...@googlegroups.com
Right! I was just checking this very same page!

So it seems it's a bug with the Arduino communications library I'm using... I'm taking a look and hope I'll be able to fix it today and get back to you.

By the way, we do have a Chinese clone and an original Arduino here, and they look and work identically except for the brand and, of course, the price tag! ;)

Best,
Bernat.

2014/1/21 Gary Chung <gary....@live.com.my>
image001.png

Bernat Romagosa

unread,
Jan 22, 2014, 3:35:59 AM1/22/14
to Gary Chung, s4a-co...@googlegroups.com
This bug seems to be much harder to fix than I thought... we've been debugging it down to the packets that are sent over the serial port, and couldn't understand what's going on.

The issue seems to appear on changing the pin modes of pins over 15. That's why output does work, because it's already set by default. So PWM, input and servos are NOT gonna work on these pins, only digital output is...

I'm really sorry to say I'm not gonna have time to look at it again before a long while, we've got some urgent big projects we absolutely need to take care of now :(

I'll add these bugs to the website as "known issues", and ask the guys responsible for the Arduino communications library if they know something about it.

Cheers,
Bernat.


2014/1/21 Bernat Romagosa <brom...@e-citilab.eu>
image001.png

Gary Chung

unread,
Feb 24, 2014, 12:18:48 PM2/24/14
to Bernat Romagosa, s4a-co...@googlegroups.com

Bernat,

Any progress rectifying the bugs ??

 

Regards

Gary

--

You received this message because you are subscribed to the Google Groups "S4A Community Mail List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s4a-communit...@googlegroups.com.
To post to this group, send email to s4a-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/s4a-community.

image001.png

Bernat Romagosa

unread,
Feb 25, 2014, 12:51:33 PM2/25/14
to Gary Chung, s4a-co...@googlegroups.com
Hi Gary,

Not really, but I've some good news in this regard. I'm gonna be working exclusively in Snap4Arduino for around 2 weeks next month, so I hope I can give it a nice push forward and fix all these issues :)

I'll keep you posted!

Thanks for your patience and feedback.

Bernat.

Gary Chung

unread,
Mar 17, 2014, 12:09:35 PM3/17/14
to Bernat Romagosa, s4a-co...@googlegroups.com

Hi Bernat,

Any updates ??

 

Regards

gary

image001.png

Bernat Romagosa

unread,
Mar 18, 2014, 4:53:56 AM3/18/14
to Gary Chung, s4a-co...@googlegroups.com
Hi Gary,

The only update there is is that the MacOSX expert is working on a fix, but I'm afraid nothing more.

The projects that are sucking most of our time happened to take much longer than we thought, but I'll get to work on this in two weeks, which is when we'll be done with these projects for good. Then I promise on my ancestors I'm gonna find a fix for all of these. Word!

As a guarantee, I'm glad to say I'll be presenting Snap4Arduino at Scratch@MIT conference on August this year, so rest assured these issues will have to be fixed, tested and buried by then! :)

Best,
Bernat.

p.s. Needless to say, this is an opensource project, so if anyone wants to take a look at the source and try a fix, please do!

Gary Chung

unread,
Mar 18, 2014, 5:17:29 AM3/18/14
to Bernat Romagosa, s4a-co...@googlegroups.com

Bernat,

 

How I wish the Scratch@MIT conference could start earlier instead of August, so that you’re pressured to

get the fix done…..LOL

 

Thanks for your updates anyway.

image001.png
Reply all
Reply to author
Forward
0 new messages