Open Sammy1Am opened 6 years ago
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.
Well... i will wait for moppy 2 because im too weak at programming..
@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.
@MuffyTarkin thank you!
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
^
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
^
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.
@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.
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
@Renarix Should be fixed
@Renarix said: