Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second Arduino Issues #183

Open
Sammy1Am opened this issue Dec 5, 2017 · 8 comments
Open

Second Arduino Issues #183

Sammy1Am opened this issue Dec 5, 2017 · 8 comments

Comments

@Sammy1Am
Copy link
Owner

Sammy1Am commented Dec 5, 2017

@Renarix said:

I have another issue.... I got secound arduino today. Just uploaded code to arduino. Went in moppy program and for channel 11 switched to Com4 and nothing works. Light on arduino blinks. Wiring is correct because when i change channel 1 from Com3 to com4 everything works. Strange... Com3 is my main arduino.

@Renarix Renarix mentioned this issue Dec 5, 2017
@Sammy1Am
Copy link
Owner Author

Sammy1Am commented Dec 5, 2017

Channel 11 will still be channel 11 when it arrives at your second Arduino, which means your Arduino would in theory try to play those notes from the drive connected to pins 22 and 23. However out of the box, the code only supports 8 drives.

You can work around this by modifying the Arduino code on the second Arduino to subtract e.g. 20 from the pin information received over serial. This should shift channel 11 (pin 22) down to channel 1 (pin 2).

Version 2.0 that I'm working on will include the ability to do this sort of channel shifting in the control GUI so you won't have to go changing as much code, but it's still a ways off from being generally usable.

@Renarix
Copy link

Renarix commented Dec 6, 2017

Well... i will wait for moppy 2 because im too weak at programming..

@MuffyTarkin
Copy link

MuffyTarkin commented Dec 7, 2017

@Renarix Here is a link to a modified Moppy code. Extract and upload the sketch in the first folder to your first Arduino (the one for drives 1-8). Upload the sketch in the second folder to the second Arduino (the one for drives 9-16).

This code also features a slight adjustment to the track length arrays. I changed them from bytes to integers so that if you decide to add something in the future like a scanner, you can more easily adjust the specific track length the Arduino will assign to that pin before shifting directions.

@Renarix
Copy link

Renarix commented Dec 9, 2017

@MuffyTarkin thank you!

@Renarix
Copy link

Renarix commented Dec 9, 2017

oh wait. When i try to upload you code it shows this error: Arduino: 1.8.2 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Renars\Desktop\arduino\UNO Moppy 1\Uno_Moppy_1\Uno_Moppy_1.ino:8:0: warning: "RESOLUTION" redefined

#define RESOLUTION 40 //Microsecond resolution for notes

^

In file included from C:\Users\Renars\Desktop\arduino\UNO Moppy 1\Uno_Moppy_1\Uno_Moppy_1.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\TimerOne/TimerOne.h:42:0: note: this is the location of the previous definition

#define RESOLUTION 65536 // Timer1 is 16 bit

^

C:\Users\Renars\Desktop\arduino\UNO Moppy 1\Uno_Moppy_1\Uno_Moppy_1.ino: In function 'void setup()':

Uno_Moppy_1:74: error: 'CurieTimerOne' was not declared in this scope

CurieTimerOne.initialize(RESOLUTION); // Set up a timer at the defined resolution

^

exit status 1
'CurieTimerOne' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@MuffyTarkin
Copy link

MuffyTarkin commented Dec 9, 2017

@Renarix ah crap, I thought I fixed that. I guess it didn't save. If you do a find and replace in both sketches, find CurieTimerOne and replace all with TimerOne. That code was also modified for using Arduino 101's but I thought I edited it back to work with a regular Uno. Guess it didn't save. Weird.

@Renarix
Copy link

Renarix commented Dec 11, 2017

There is something wrong in your code. When i try to play music head doesnt move back and forward. It just go in one direction. Original code works flawlessly

@Lothean
Copy link

Lothean commented Mar 9, 2018

@Renarix Should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants