mitxela.com forum
Welcome. Please log in or register.

Touch Screen as a MIDI Ribbon Controller
sammy Posted: 25 Dec 2019, 09:12 AM
Avatar


Member
Posts: 1
Joined: 25-December 19
Dear - How to fix the Code Error in Arduino. It's showing me such a kind of error, pasted below :
*************************************************************************
C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino: In function 'void sendPitchBendRange()':

2attiny85:11:3: error: 'uchar' was not declared in this scope

uchar pitchBendRange[8] = {0x0B, 0xB0, 101, 0, 0x0B, 0xB0, 100, 0};

^~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:11:3: note: suggested alternative: 'char'

uchar pitchBendRange[8] = {0x0B, 0xB0, 101, 0, 0x0B, 0xB0, 100, 0};

^~~~~

char

2attiny85:12:11: error: 'usbInterruptIsReady' was not declared in this scope

while (!usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:12:11: note: suggested alternative: 'noInterrupts'

while (!usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

noInterrupts

2attiny85:13:5: error: 'wdt_reset' was not declared in this scope

wdt_reset();

^~~~~~~~~

2attiny85:14:5: error: 'usbPoll' was not declared in this scope

usbPoll();

^~~~~~~

2attiny85:16:19: error: 'pitchBendRange' was not declared in this scope

usbSetInterrupt(pitchBendRange, 8);

^~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:16:19: note: suggested alternative: 'sendPitchBendRange'

usbSetInterrupt(pitchBendRange, 8);

^~~~~~~~~~~~~~

sendPitchBendRange

2attiny85:16:3: error: 'usbSetInterrupt' was not declared in this scope

usbSetInterrupt(pitchBendRange, 8);

^~~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:16:3: note: suggested alternative: 'detachInterrupt'

usbSetInterrupt(pitchBendRange, 8);

^~~~~~~~~~~~~~~

detachInterrupt

2attiny85:18:11: error: 'usbInterruptIsReady' was not declared in this scope

while (!usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:18:11: note: suggested alternative: 'noInterrupts'

while (!usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

noInterrupts

2attiny85:19:5: error: 'wdt_reset' was not declared in this scope

wdt_reset();

^~~~~~~~~

2attiny85:20:5: error: 'usbPoll' was not declared in this scope

usbPoll();

^~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino: In function 'int main()':

2attiny85:29:3: error: 'uchar' was not declared in this scope

uchar i;

^~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:29:3: note: suggested alternative: 'char'

uchar i;

^~~~~

char

2attiny85:30:10: error: expected ';' before 'sentPBR'

uchar sentPBR =0;

^~~~~~~

2attiny85:31:10: error: expected ';' before 'calibrationValue'

uchar calibrationValue;

^~~~~~~~~~~~~~~~

2attiny85:32:10: error: expected ';' before 'midiMsg'

uchar midiMsg[8];

^~~~~~~

2attiny85:43:3: error: 'calibrationValue' was not declared in this scope

calibrationValue = eeprom_read_byte(0); /* calibration value from last time */

^~~~~~~~~~~~~~~~

2attiny85:47:3: error: 'usbDeviceDisconnect' was not declared in this scope

usbDeviceDisconnect();

^~~~~~~~~~~~~~~~~~~

2attiny85:48:7: error: 'i' was not declared in this scope

for(i=0;i<20;i++){ /* 300 ms disconnect */

^

2attiny85:51:3: error: 'usbDeviceConnect' was not declared in this scope

usbDeviceConnect();

^~~~~~~~~~~~~~~~

2attiny85:53:14: error: 'WDTO_1S' was not declared in this scope

wdt_enable(WDTO_1S);

^~~~~~~

2attiny85:53:3: error: 'wdt_enable' was not declared in this scope

wdt_enable(WDTO_1S);

^~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:53:3: note: suggested alternative: 'mutable'

wdt_enable(WDTO_1S);

^~~~~~~~~~

mutable

2attiny85:55:3: error: 'usbInit' was not declared in this scope

usbInit();

^~~~~~~

2attiny85:60:32: error: 'sentPBR' was not declared in this scope

if ((PINB & 1<<PB4)==0 && !sentPBR) {

^~~~~~~

2attiny85:65:5: error: 'wdt_reset' was not declared in this scope

wdt_reset();

^~~~~~~~~

2attiny85:66:5: error: 'usbPoll' was not declared in this scope

usbPoll();

^~~~~~~

2attiny85:67:8: error: 'usbInterruptIsReady' was not declared in this scope

if(usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:67:8: note: suggested alternative: 'noInterrupts'

if(usbInterruptIsReady()){

^~~~~~~~~~~~~~~~~~~

noInterrupts

2attiny85:74:9: error: 'i' was not declared in this scope

i=0;

^

2attiny85:76:11: error: 'midiMsg' was not declared in this scope

midiMsg[i++]= 0x09;

^~~~~~~

2attiny85:81:11: error: 'midiMsg' was not declared in this scope

midiMsg[i++]= 0x08;

^~~~~~~

2attiny85:87:11: error: 'midiMsg' was not declared in this scope

midiMsg[i++]= 0x0E;

^~~~~~~

2attiny85:94:25: error: 'midiMsg' was not declared in this scope

usbSetInterrupt(midiMsg, i);

^~~~~~~

2attiny85:94:9: error: 'usbSetInterrupt' was not declared in this scope

usbSetInterrupt(midiMsg, i);

^~~~~~~~~~~~~~~

C:\Users\shyan\OneDrive\Desktop\arduino\attiny85\1attiny85.ino\2attiny85\2attiny85.ino:94:9: note: suggested alternative: 'detachInterrupt'

usbSetInterrupt(midiMsg, i);

^~~~~~~~~~~~~~~

detachInterrupt

2attiny85:95:9: error: 'sentPBR' was not declared in this scope

sentPBR=0;

^~~~~~~

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

******************************************************************

Kindly suggest to solve, at least about "'uchar' was not declared in this scope".

Thanks & Regards
Email : smsammy0@gmail.com


-------------
[top]
mit Posted: 26 Dec 2019, 12:12 AM
Avatar
yeah whatever

Admin
Posts: 246
Joined: 4-May 16
Hi, take a look at the V-USB example projects and also the source code to some of my other attiny85 usb-midi projects, the ribbon controller only has part of the source on the project page.

You might also want to look at an example USB-MIDI project using arduino, because there may be other things you need to do to get it to work with it.

uchar is a V-USB macro that is just unsigned char. You can probably fix it by typing at the start of your program:

#define uchar unsigned char


Looks like the rest of the errors cascade from there.

-------------
[top]
DAVID Posted: 26 Dec 2019, 06:12 AM
Avatar
avrs + midi = best diy synths

Member
Posts: 220
Joined: 10-September 17
Hi, I´m an expert when it comes in to using the Arduino IDE.
What Mitxela did was just to put the main file of a V-USB example in his project page, so you will obviously have to provide the V-USB library.
So to make it painless for you I made an Arduino library for you.
https://github.com/theawsomeavr/Mitxelas_Ribbon_Controller

Only thing that you have to do is to include this in your arduino library folder and open the example called "Mitxelas_Ribbon_Controller.ino" and Done!!!!!

-------------
[top]
DAVID Posted: 26 Dec 2019, 06:12 AM
Avatar
avrs + midi = best diy synths

Member
Posts: 220
Joined: 10-September 17
I haven´t tested it yet so tell me if it works

-------------
[top]

Sign in to post a reply.