Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro...
Transcript of Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro...
![Page 1: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/1.jpg)
Programming, Serial and Virtual Prototyping
![Page 2: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/2.jpg)
Code
if ( You like semicolons ) {Stay here for intro to Arduino code}
else {Join the MODKit group for GUI code}
![Page 3: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/3.jpg)
Serial Communication
Serial Communication is the transferring and receiving of information between two machines, the Arduino dedicates pin # 0 to receiving information and pin 1 to transferring information
![Page 4: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/4.jpg)
Serial in Setup
![Page 5: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/5.jpg)
Serial Monitor
![Page 6: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/6.jpg)
Serial Communication
![Page 7: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/7.jpg)
Serial Activity with
Circuit 7• Communication• Troubleshooting
circuits• Debugging Code
![Page 8: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/8.jpg)
Serial Communication:Serial Setup
void setup ( ) {Serial.begin ( 9600 ) ;}
In this case the number 9600 is the baudrate at which the computer and Arduino
communicate
![Page 9: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/9.jpg)
Serial Communication:Sending a Message
void loop ( ) {Serial.print ( “Constructivism & “
) ;
Serial.println ( “Mechatronics” ) ;}
![Page 10: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/10.jpg)
Serial Communication:Serial Debugging
void loop ( ) {int xVar = 10 ;Serial.print ( “Variable xVar is “ )
;Serial.println ( xVar ) ;}
![Page 11: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/11.jpg)
Serial Communication:Serial Troubleshooting
void loop ( ) {Serial.print ( “Digital pin 9 reads
“ ) ;Serial.println ( digitalRead
( 9 ) ) ;}
![Page 12: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/12.jpg)
Serial Communication:Circuit 7 code
void loop ( ) {
buttonState = digitalRead(inputPin);
if (buttonState== HIGH){
digitalWrite (ledPin, LOW)
}
else {
digitalWrite(ledPin, HIGH);
Serial.print (“button state is “);
Serial.println ( buttonState );}
}
![Page 13: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/13.jpg)
Fritzing
Now that you feel comfortable putting together circuits with your breadboard let’s talk about how to go from the breadboard to a PCB
![Page 14: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/14.jpg)
Free Time
The rest of the class is dedicated to free pursuit
Do whatever you like and an instructor will help you with any questions or problems you may have, this includes questions about personal projects using Arduino
Thank you for attending our Intro to Arduino class
Please fill out a class feedback form before you leave
![Page 15: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/15.jpg)
Questions?
![Page 16: Programming, Serial and Virtual Prototyping. Code if ( You like semicolons ) { Stay here for intro to Arduino code } else { Join the MODKit group for.](https://reader035.fdocuments.in/reader035/viewer/2022070415/5697bfd41a28abf838cacec8/html5/thumbnails/16.jpg)
www.sparkfun.com6175 Longbow Drive, Suite 200
Boulder, Colorado 80301