Are you looking to get a discount on popular programming courses? Then click here. View offers

TODAY'S OFFERS
close

Select from the best sales here

VIEW ALL DISCOUNTS

An Introduction to Programming the Internet of Things (IoT) Specialization (coursera.pxf.io)

Visita Tutorial
Pagado Vídeo Principiante
#5 de un total de 22 Arduino Tutoriales y Cursos 6.2k+ vistas

remitente

educador

Ian Harris
110 puntos

¿Por qué a los programmers les gusta este tutorial?

Calidad del contenido

Instructor calificado

Calidad de video

Ritmo del curso

Profundidad del curso y cobertura

Escribe tu reseña de este tutorial:

También puede hacer preguntas o proporcionar cualquier información que pueda ser útil para las personas que toman este curso.

Ayesha Salman
Ayesha Salman 10 puntos
hace 2 años


I'm getting this problem with arduino switch please help!

I believe the arduino that I got from w11stop.com/arduino as i think it's SWITCH statement has some compile time problems.

If I try to declare a boolean variable in a CASE statement as illustrated in "case 2: in the snippet below, the compiler throws an error.

I add this to the other CASE statement problem I flagged earlier: ie. the compiler does not throw an error if you misspell "default" as "defalut.")

CODE

switch (var) {
case 1:
//do something when var equals 1
break;
case 2:
boolean X;
//do something when var equals 2
break;
default:
// if nothing else matches, do the default
// default is optional
break;
}

This appears to be a problem with the compiler, NOT my code, and it seems to happen only with nested SWITCH statements.

Thank in advance for your prompt response.