Comments (7)
Thanks, I'll look into it.
from mozzi.
Hi sensorium, thanks for taking a look at it. Did you find a workaround for the teensy2? I am still trying to get it to work but with no success so far.
from mozzi.
Hi loopmasta,
could you please test this for me? Replace the "Teensy 2 hack" code at the
end of mozzi_analog.h with this below..
It compiles here, but I'm not sure if it will work with the "extern" word
at the start of the array declaration. If it doesn't work, try replacing
"extern" with "static".
Cheers.
Let me know the results.
Thanks,
Tim
//////////////////////////
// hack for Teensy 2 (ATmega32U4), which has "adc_mapping" instead of
"analog_pin_to_channel_PGM"
#if defined(AVR_ATmega32U4) && defined(CORE_TEENSY)
//pasted from hardware/arduino/variants/leonardo/pins_arduino.h, doesn't
work as of mozzi 0.01.2a
// AVR_ATmega32U4 has an unusual mapping of pins to channels
//extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
//#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM
- (P) ) )
// look at
Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy/pins_teensy.c
- analogRead
// adc_mapping is already declared in pins_teensy.c, but it's static there
extern const uint8_t PROGMEM adc_mapping[] = {
// 0, 1, 4, 5, 6, 7, 13, 12, 11, 10, 9, 8
0, 1, 4, 5, 6, 7, 13, 12, 11, 10, 9, 8, 10, 11, 12, 13, 7, 6, 5, 4, 1,
0, 8
};
#define analogPinToChannel(P) ( pgm_read_byte( adc_mapping + (P) ) )
#endif
///////////////////////
On 16 June 2013 19:07, loopmasta [email protected] wrote:
Hi sensorium, thanks for taking a look at it. Did you find a workaround
for the teensy2? I am still trying to get it to work but with no success so
far.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-19509803
.
from mozzi.
Hi sensorium,
your code addition for the teensy2 works perfect.
Thank you very much for your help.
loopmasta
from mozzi.
Hello! Three years from this post. I am also having trouble to get mozzi working on a teensy 2.0. The error is lengthier; and far from my understanding:
`In file included from [...]\Arduino\libraries\Mozzi-1.0.2\examples\01.Basics\Sinewave\Sinewave.ino:17:0:
[...]\Arduino\libraries\Mozzi-1.0.2/MozziGuts.h:151:2: warning: #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h. If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch." [-Wcpp]
#warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h. If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch."
^
In file included from [...]\Arduino\libraries\Mozzi-1.0.2\MozziGuts.cpp:19:0:
[...]\Arduino\libraries\Mozzi-1.0.2\MozziGuts.h:151:2: warning: #warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h. If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch." [-Wcpp]
#warning "AUDIO_MODE is set to STANDARD_PLUS in mozzi_config.h. If things sound wrong, check if STANDARD_PLUS is the correct AUDIO_MODE for your sketch."
^
In file included from [...]\Arduino\libraries\Mozzi-1.0.2\MozziGuts.cpp:29:0:
[...]\Arduino\libraries\Mozzi-1.0.2\utility/TimerOne.h: In function 'void startMozzi(int)':
[...]\Arduino\libraries\Mozzi-1.0.2\utility/TimerOne.h:90:22: warning: 'cycles' may be used uninitialized in this function [-Wmaybe-uninitialized]
pwmPeriod = cycles;
^
[...]\Arduino\libraries\Mozzi-1.0.2\utility/TimerOne.h:73:17: note: 'cycles' was declared here
unsigned long cycles;
^
[...]\Arduino\libraries\Mozzi-1.0.2\mozzi_utils.cpp: In function 'long int trailingZeros(long unsigned int)':
[...]\Arduino\libraries\Mozzi-1.0.2\mozzi_utils.cpp:12:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
return (*(uint32_t *)&f >> 23) - 0x7f;
^
[...]\Arduino\libraries\Mozzi-1.0.2\utility\FrequencyTimer2.cpp:84:65: error: no 'void FrequencyTimer2::setPeriodMicroSeconds(long unsigned int)' member function declared in class 'FrequencyTimer2'
void FrequencyTimer2::setPeriodMicroSeconds(unsigned long period) {
^
[...]\Arduino\libraries\Mozzi-1.0.2\utility\FrequencyTimer2.cpp:90:62: error: no 'void FrequencyTimer2::setPeriodCPUCycles(long unsigned int)' member function declared in class 'FrequencyTimer2'
void FrequencyTimer2::setPeriodCPUCycles(unsigned long period){
^
exit status 1
Error compiling.
`
from mozzi.
Well this report is rather old by now. @autotel are you still with us? Do you still see this error, in this, or a more recent release of Mozzi?
If so, I guess that it is a problem with a clash with a separately installed "FrequencyTimer2" library. Could you test, whether the following helps:
In Arduino\libraries\Mozzi-1.0.2\utility\FrequencyTimer2.cpp , near the top, replace #include <FrequencyTimer2.h>
with #include "FrequencyTimer2.h"
(i.e. quotes instead of angle brackets).
Thanks!
from mozzi.
Fix worked and the issue is far too old by now. :-)
from mozzi.
Related Issues (20)
- Compilation errors when including both WaveFolder.h and ResonantFilter.h HOT 3
- Unable to compile for Atmega328PB with Arduino IDE HOT 3
- Sample example not working on UNO R4 HOT 11
- Arduino Nano 33 IoT tested and works with the output on DAC0, which is also called A0 HOT 2
- Output frequency 0.25% off on AVRs HOT 1
- RFC: Mozzi 2.0 part 1: Single compilation unit HOT 7
- RFC: Mozzi 2.0 part 2 - Configuration restructuring HOT 7
- Improving fixMath HOT 5
- Please Change Mozzi's License HOT 10
- Using Mozzi and I2C library for LCD HOT 14
- RFC: Mozzi 2.0 part 3 - Miscellanious
- UNO R4 port broken HOT 2
- Compatability/Compilation Issues w/ Nano 33 BLE Sense HOT 5
- Apparent frequency drops when amplitude increased beyond 8 bits on AVR HOT 3
- mozzi_rand cannot go full range HOT 7
- AVR PWM range is not actually 0-488 ("8.5 bit"), but effectively 0-400 HOT 6
- Minor / infrastructure: Avoid duplicate workflow runs on pushes to PRs HOT 1
- I2S dac with a nano. HOT 12
- VS10XX as DAC HOT 38
- RFC: Analog input scaling - what's the best approach HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mozzi.