Zoltan Hudak / Mbed 2 deprecated BarcodeReader_F103

Dependencies:   mbed zbar

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Fri Jan 10 22:10:07 2020 +0000
Parent:
2:415e979c52cf
Commit message:
Barcode reader with a TCD1304AP TOSHIBA CCD linear image sensor and NUCLEO-F103RB board.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
zbar.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jan 10 21:03:00 2020 +0000
+++ b/main.cpp	Fri Jan 10 22:10:07 2020 +0000
@@ -2,12 +2,12 @@
  * Barcode reader
  *
  * Target:  NUCLEO-F103RB
- * Sensor:  TCD1304AP(DG) - Toshiba CCD linear image sensor
+ * Sensor:  TCD1304AP(DG) - TOSHIBA CCD linear image sensor
  *
  * Author:  Zoltan Hudak
  * Date:    2020-01
  *
- * Depends on the ZBar library <http://zbar.sourceforge.net/>
+ * Depends on the ZBar library <http://zbar.sourceforge.net>
  *
  */
 #include "main.h"
@@ -169,8 +169,8 @@
             scanner->flush();
             scanner->new_scan();
 
-            int black = 0;
-            int i;
+            uint16_t  black = 0;
+            int       i;
 
             for (i = MARGIN_LEFT; i < DATA_LEN - MARGIN_RIGHT; i++) {
                 if (adcData[i] > black)
@@ -178,7 +178,7 @@
             }
 
             for (i = MARGIN_LEFT; i < DATA_LEN - MARGIN_RIGHT; i++) {
-                scanner->scan_y(adcData[i] - black);
+                scanner->scan_y(black - adcData[i]);
             }
 #endif
             printf("Scan done.\r\n");
--- a/mbed_app.json	Fri Jan 10 21:03:00 2020 +0000
+++ b/mbed_app.json	Fri Jan 10 22:10:07 2020 +0000
@@ -1,7 +1,6 @@
 {
     "target_overrides": {
         "*": {
-            "target.clock_source": "USE_PLL_HSE_XTAL",
             "target.default_lib": "small"
         }
     }
--- a/zbar.lib	Fri Jan 10 21:03:00 2020 +0000
+++ b/zbar.lib	Fri Jan 10 22:10:07 2020 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/hudakz/code/zbar/#e33621169e44
+https://os.mbed.com/users/hudakz/code/zbar/#4f5c042a2d34