test vscode
This commit is contained in:
20
src/main.cpp
20
src/main.cpp
@ -19,10 +19,14 @@
|
||||
https://www.arduino.cc/en/Tutorial/BuiltInExamples/ASCIITable
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
//Initialize serial and wait for port to open:
|
||||
// TEST
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Initialize serial and wait for port to open:
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
while (!Serial)
|
||||
{
|
||||
; // wait for serial port to connect. Needed for native USB port only
|
||||
}
|
||||
|
||||
@ -36,7 +40,8 @@ int thisByte = 33;
|
||||
// for example, '!' is the same as 33, so you could also use this:
|
||||
// int thisByte = '!';
|
||||
|
||||
void loop() {
|
||||
void loop()
|
||||
{
|
||||
// prints value unaltered, i.e. the raw binary version of the byte.
|
||||
// The Serial Monitor interprets all bytes as ASCII, so 33, the first number,
|
||||
// will show up as '!'
|
||||
@ -52,7 +57,6 @@ void loop() {
|
||||
|
||||
// Serial.print(thisByte, DEC);
|
||||
|
||||
|
||||
Serial.print(", hex: ");
|
||||
// prints value as string in hexadecimal (base 16):
|
||||
Serial.print(thisByte);
|
||||
@ -66,9 +70,11 @@ void loop() {
|
||||
Serial.println(thisByte);
|
||||
|
||||
// if printed last visible character '~' or 126, stop:
|
||||
if (thisByte == 126) { // you could also use if (thisByte == '~') {
|
||||
if (thisByte == 126)
|
||||
{ // you could also use if (thisByte == '~') {
|
||||
// This loop loops forever and does nothing
|
||||
while (true) {
|
||||
while (true)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user