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